|
|
@ -54,8 +54,6 @@ 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, "保存失败") |
|
|
@ -242,13 +240,13 @@ func (this *BlogController) SyncBlog() { |
|
|
|
list, err := blogService.AllBlogs() |
|
|
|
var i = 0 |
|
|
|
if err != nil { |
|
|
|
this.Data["json"] = models.ReurnError(500,""); |
|
|
|
this.Data["json"] = models.ReurnError(500, "") |
|
|
|
this.ServeJSON() |
|
|
|
} |
|
|
|
for index := range list { |
|
|
|
utils.ESSave(list[index]) |
|
|
|
i++ |
|
|
|
} |
|
|
|
this.Data["json"] = models.ReurnData("",i) |
|
|
|
this.Data["json"] = models.ReurnData("", i) |
|
|
|
this.ServeJSON() |
|
|
|
} |
|
|
|