Exemple #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"
}
Exemple #2
0
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

}