Browse Source

基本设置-网站信息

master
huangjiajun 1 week ago
parent
commit
1a9bbb7990
3 changed files with 10 additions and 15 deletions
  1. +7
    -15
      app/hdl/setCenter/web/hdl_basic.go
  2. +2
    -0
      app/md/setCenter/md_web.go
  3. +1
    -0
      app/router/router.go

+ 7
- 15
app/hdl/setCenter/web/hdl_basic.go View File

@@ -24,6 +24,7 @@ func GetBasic(c *gin.Context) {
SeoLogoUrl: svc.GetOssUrl(svc.GetSysCfgStr("seo_logo")), SeoLogoUrl: svc.GetOssUrl(svc.GetSysCfgStr("seo_logo")),
WebLogo: svc.GetSysCfgStr("web_logo"), WebLogo: svc.GetSysCfgStr("web_logo"),
WebLogoUrl: svc.GetOssUrl(svc.GetSysCfgStr("web_logo")), WebLogoUrl: svc.GetOssUrl(svc.GetSysCfgStr("web_logo")),
WapHost: svc.GetOssUrl(svc.GetSysCfgStr("wap_host")),
} }


e.OutSuc(c, resp, nil) e.OutSuc(c, resp, nil)
@@ -47,25 +48,16 @@ func SetBasic(c *gin.Context) {
return return
} }
if req.WebLogo != "" { 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 != "" { 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 != "" { 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) e.OutSuc(c, "success", nil)
return return


+ 2
- 0
app/md/setCenter/md_web.go View File

@@ -6,9 +6,11 @@ type WebBasicResp struct {
SeoLogoUrl string `json:"seo_logo_url"` SeoLogoUrl string `json:"seo_logo_url"`
WebLogo string `json:"web_logo"` WebLogo string `json:"web_logo"`
WebLogoUrl string `json:"web_logo_url"` WebLogoUrl string `json:"web_logo_url"`
WapHost string `json:"wap_host" example:"h5域名"`
} }
type WebBasicReq struct { type WebBasicReq struct {
SeoTitle string `json:"seo_title"` SeoTitle string `json:"seo_title"`
SeoLogo string `json:"seo_logo"` SeoLogo string `json:"seo_logo"`
WebLogo string `json:"web_logo"` WebLogo string `json:"web_logo"`
WapHost string `json:"wap_host" example:"h5域名"`
} }

+ 1
- 0
app/router/router.go View File

@@ -103,6 +103,7 @@ func rSettCenter(r *gin.RouterGroup) { //设置中心
rOssAliYun.POST("/setBasic", aliyun.SetBasic) rOssAliYun.POST("/setBasic", aliyun.SetBasic)
} }
} }

rWeb := r.Group("/web") //网站信息 rWeb := r.Group("/web") //网站信息
{ {
rWeb.GET("/getBasic", web.GetBasic) rWeb.GET("/getBasic", web.GetBasic)


Loading…
Cancel
Save