diff --git a/controller/about.go b/controller/about.go new file mode 100644 index 0000000..2866aca --- /dev/null +++ b/controller/about.go @@ -0,0 +1,19 @@ +package controller + +import ( + "github.com/gin-gonic/gin" + "github.com/taoshihan1991/imaptool/models" +) + +func GetAbout(c *gin.Context) { + page := c.Query("page") + if page == "" { + page = "index" + } + about := models.FindAboutByPage(page) + c.JSON(200, gin.H{ + "code": 200, + "msg": "ok", + "result": about, + }) +} diff --git a/router/api.go b/router/api.go index 0708c93..f640fb1 100644 --- a/router/api.go +++ b/router/api.go @@ -49,6 +49,7 @@ func InitApiRouter(engine *gin.Engine) { engine.GET("/visitors", middleware.JwtApiMiddleware, controller.GetVisitors) engine.GET("/statistics", middleware.JwtApiMiddleware, controller.GetStatistics) //前台接口 + engine.GET("/about", controller.GetAbout) engine.GET("/notice", middleware.SetLanguage, controller.GetNotice) engine.POST("/notice", middleware.JwtApiMiddleware, controller.PostNotice) engine.DELETE("/notice", middleware.JwtApiMiddleware, controller.DelNotice) diff --git a/static/html/setting_bottom.html b/static/html/setting_bottom.html index f50e39e..c4e7a54 100644 --- a/static/html/setting_bottom.html +++ b/static/html/setting_bottom.html @@ -84,7 +84,15 @@ }, statistics:{}, pageindex: { - titlecn: "", + title_cn: "", + title_en: "", + keywords_cn: "", + keywords_en: "", + desc_cn: "", + desc_en: "", + css_js: "", + html_cn: "", + html_en: "", }, }, methods: { @@ -212,7 +220,9 @@ }); } if(ACTION=="setting_pageindex"){ - + this.sendAjax("/about","get",{},function(result){ + _this.pageindex=result; + }); } }, sendAjax(url,method,params,callback){ diff --git a/static/html/setting_pageindex.html b/static/html/setting_pageindex.html index eadbbf7..6fe6212 100644 --- a/static/html/setting_pageindex.html +++ b/static/html/setting_pageindex.html @@ -6,34 +6,34 @@ - + - + - + - + - + - + - + - + - + - 保存 + 保存 取消