From a64754c1f1d9e4532e21fc42d5a85caba16d66fd Mon Sep 17 00:00:00 2001 From: taoshihan1991 <630892807@qq.com> Date: Wed, 14 Oct 2020 10:43:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A1=B9=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E8=8E=B7=E5=8F=96=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/about.go | 19 +++++++++++++++++++ router/api.go | 1 + static/html/setting_bottom.html | 14 ++++++++++++-- static/html/setting_pageindex.html | 20 ++++++++++---------- 4 files changed, 42 insertions(+), 12 deletions(-) create mode 100644 controller/about.go 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 @@ - + - + - + - + - + - + - + - + - + - 保存 + 保存 取消