Browse Source

bug修复

layui
yasaka 5 years ago
parent
commit
dfe8e7ce91
  1. 6
      controllers/BlogController.go

6
controllers/BlogController.go

@ -54,8 +54,6 @@ func (this *BlogController) Save() {
err := blogService.SaveBlog(blog, labels) err := blogService.SaveBlog(blog, labels)
if err == nil { if err == nil {
this.Data["json"] = models.ReurnData("", blog.Id) this.Data["json"] = models.ReurnData("", blog.Id)
blog.User.Salt = ""
blog.User.UserPwd = ""
utils.ESSave(blog) utils.ESSave(blog)
} else { } else {
this.Data["json"] = models.ReurnError(500, "保存失败") this.Data["json"] = models.ReurnError(500, "保存失败")
@ -242,13 +240,13 @@ func (this *BlogController) SyncBlog() {
list, err := blogService.AllBlogs() list, err := blogService.AllBlogs()
var i = 0 var i = 0
if err != nil { if err != nil {
this.Data["json"] = models.ReurnError(500,""); this.Data["json"] = models.ReurnError(500, "")
this.ServeJSON() this.ServeJSON()
} }
for index := range list { for index := range list {
utils.ESSave(list[index]) utils.ESSave(list[index])
i++ i++
} }
this.Data["json"] = models.ReurnData("",i) this.Data["json"] = models.ReurnData("", i)
this.ServeJSON() this.ServeJSON()
} }

Loading…
Cancel
Save