From ed39ccccc00d6b61caff1cb0492b2fb504b9e54a Mon Sep 17 00:00:00 2001 From: "mail_yanpeng@163.com" Date: Wed, 22 May 2019 12:53:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/BlogController.go | 8 +++++++- controllers/NoteController.go | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/controllers/BlogController.go b/controllers/BlogController.go index 3211dd6..a474a0e 100644 --- a/controllers/BlogController.go +++ b/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") diff --git a/controllers/NoteController.go b/controllers/NoteController.go index 77b5e0d..ac0cf58 100644 --- a/controllers/NoteController.go +++ b/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 {