MCPcopy Index your code
hub / github.com/TruthHun/BookStack / Seo

Method Seo

controllers/ManagerController.go:819–841  ·  view source on GitHub ↗

SEO管理

()

Source from the content-addressed store, hash-verified

817
818// SEO管理
819func (this *ManagerController) Seo() {
820 o := orm.NewOrm()
821 if this.Ctx.Input.IsPost() { //SEO更新
822 rows, err := o.QueryTable(models.TableSeo).Filter("id", this.GetString("id")).Update(map[string]interface{}{
823 this.GetString("field"): this.GetString("value"),
824 })
825 if err != nil {
826 beego.Error(err.Error())
827 this.JsonResult(1, "更新失败,请求错误")
828 }
829 if rows > 0 {
830 this.JsonResult(0, "更新成功")
831 }
832 this.JsonResult(1, "更新失败,您未对内容做更改")
833 }
834
835 //SEO展示
836 var seos []models.Seo
837 o.QueryTable(models.TableSeo).All(&seos)
838 this.Data["Lists"] = seos
839 this.Data["IsManagerSeo"] = true
840 this.TplName = "manager/seo.html"
841}
842
843func (this *ManagerController) UpdateAds() {
844 id, _ := this.GetInt("id")

Callers

nothing calls this directly

Calls 3

JsonResultMethod · 0.80
UpdateMethod · 0.45
AllMethod · 0.45

Tested by

no test coverage detected