Quellcode durchsuchen

基本设置-网站信息

master
huangjiajun vor 2 Wochen
Ursprung
Commit
1a9bbb7990
3 geänderte Dateien mit 10 neuen und 15 gelöschten Zeilen
  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 Datei anzeigen

@@ -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


+ 2
- 0
app/md/setCenter/md_web.go Datei anzeigen

@@ -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域名"`
}

+ 1
- 0
app/router/router.go Datei anzeigen

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

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


||||||
x
 
000:0
Laden…
Abbrechen
Speichern