diff --git a/app/hdl/setCenter/web/hdl_basic.go b/app/hdl/setCenter/web/hdl_basic.go index b50b61b..00dac51 100644 --- a/app/hdl/setCenter/web/hdl_basic.go +++ b/app/hdl/setCenter/web/hdl_basic.go @@ -24,6 +24,7 @@ func GetBasic(c *gin.Context) { SeoLogoUrl: svc.GetOssUrl(svc.GetSysCfgStr("seo_logo")), WebLogo: svc.GetSysCfgStr("web_logo"), WebLogoUrl: svc.GetOssUrl(svc.GetSysCfgStr("web_logo")), + WapHost: svc.GetOssUrl(svc.GetSysCfgStr("wap_host")), } e.OutSuc(c, resp, nil) @@ -47,25 +48,16 @@ func SetBasic(c *gin.Context) { return } if req.WebLogo != "" { - bools := svc.SetSysCfgStr("web_logo", req.WebLogo) - if bools == false { - e.OutErr(c, 400, e.NewErr(400, "保存失败")) - return - } + svc.SetSysCfgStr("web_logo", req.WebLogo) + } + if req.WapHost != "" { + svc.SetSysCfgStr("wap_host", req.WapHost) } if req.SeoLogo != "" { - bools := svc.SetSysCfgStr("seo_logo", req.SeoLogo) - if bools == false { - e.OutErr(c, 400, e.NewErr(400, "保存失败")) - return - } + svc.SetSysCfgStr("seo_logo", req.SeoLogo) } if req.SeoTitle != "" { - bools := svc.SetSysCfgStr("seo_title", req.SeoTitle) - if bools == false { - e.OutErr(c, 400, e.NewErr(400, "保存失败")) - return - } + svc.SetSysCfgStr("seo_title", req.SeoTitle) } e.OutSuc(c, "success", nil) return diff --git a/app/md/setCenter/md_web.go b/app/md/setCenter/md_web.go index e70fcc6..8102f16 100644 --- a/app/md/setCenter/md_web.go +++ b/app/md/setCenter/md_web.go @@ -6,9 +6,11 @@ type WebBasicResp struct { SeoLogoUrl string `json:"seo_logo_url"` WebLogo string `json:"web_logo"` WebLogoUrl string `json:"web_logo_url"` + WapHost string `json:"wap_host" example:"h5域名"` } type WebBasicReq struct { SeoTitle string `json:"seo_title"` SeoLogo string `json:"seo_logo"` WebLogo string `json:"web_logo"` + WapHost string `json:"wap_host" example:"h5域名"` } diff --git a/app/router/router.go b/app/router/router.go index bbb310a..f0aeb71 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -103,6 +103,7 @@ func rSettCenter(r *gin.RouterGroup) { //设置中心 rOssAliYun.POST("/setBasic", aliyun.SetBasic) } } + rWeb := r.Group("/web") //网站信息 { rWeb.GET("/getBasic", web.GetBasic)