示例#1
0
func (t *TopicController) Add() {
	if !checkAccount(t.Ctx) {
		t.TplNames = "login.html"
		return
	}
	t.Data["IsLogin"] = checkAccount(t.Ctx)
	t.Data["IsTopic"] = true
	t.Data["Category"], _ = models.GetAllCategories()
	t.Data["Sheng"], _ = models.GetXzqById("")
	t.TplNames = "topic_add.html"
}
示例#2
0
文件: xzq.go 项目: moonstudio/MyTools
func (x *XzqController) Post() {
	xzq := x.Input().Get("xzq")
	var xzqs, _ = models.GetXzqById(xzq)

	if xzqJson, err := json.Marshal(xzqs); err == nil {
		fmt.Println("###################################", string(xzqJson))
		x.Data["xzqJson"] = string(xzqJson)
	}

	x.ServeJson()
	return

}