mail_yanpeng@163.com před 6 roky
rodič
revize
ed39ccccc0
  1. 8
      controllers/BlogController.go
  2. 1
      controllers/NoteController.go

8
controllers/BlogController.go

@ -54,6 +54,9 @@ func (this *BlogController) Save() {
err := blogService.SaveBlog(blog, labels)
if err == nil {
this.Data["json"] = models.ReurnData("", blog.Id)
blog.User.Salt = ""
blog.User.UserPwd = ""
utils.ESSave(blog)
} else {
this.Data["json"] = models.ReurnError(500, "保存失败")
}
@ -92,6 +95,9 @@ func (this *BlogController) Edit() {
err = blogService.EditBlog(blog, labels)
if err == nil {
this.Data["json"] = models.ReurnSuccess("")
blog.User.Salt = ""
blog.User.UserPwd = ""
utils.ESSave(blog)
} else {
this.Data["json"] = models.ReurnError(500, "保存失败")
}
@ -125,7 +131,7 @@ func (this *BlogController) Get() {
this.Data["Top"] = blogs
}
//utils.Index()
utils.ESSave(blog)
//utils.ESSave(blog)
this.Data["Blog"] = blog
this.Data["UserId"] = this.GetSession("userid")
this.Data["HeadImg"] = this.GetSession("headimg")

1
controllers/NoteController.go

@ -186,6 +186,7 @@ func (this *NoteController) Note() {
uid := this.GetSession("userid")
if uid == nil {
this.Redirect("/login", 302)
return
}
noteColls, err := noteService.GetNoteColl(uid.(int64))
if err == nil {

Načítá se…
Zrušit
Uložit