func (this *TopicController) Get() { this.Data["isTopic"] = true this.Data["isLogin"] = checkAccount(this.Ctx) this.TplNames = "topic.html" fmt.Println("11111") topics, err := modules.GetAllTopics(false) if err != nil { fmt.Println("22222") beego.Error(err) } else { this.Data["Topics"] = topics fmt.Println(topics) } }
func (c *MainController) Get() { c.Data["isHome"] = true c.Data["isCategoty"] = false c.Data["isTopic"] = false c.Data["isLogin"] = checkAccount(c.Ctx) topics, err := modules.GetAllTopics(true) if err != nil { beego.Error(err) } else { c.Data["Topics"] = topics } c.TplNames = "Home.html" }