From 1a9bbb7990b157f90b4c53045496c6d0e647f60a Mon Sep 17 00:00:00 2001
From: huangjiajun <582604932@qq.com>
Date: Fri, 6 Dec 2024 14:31:38 +0800
Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E8=AE=BE=E7=BD=AE-=E7=BD=91?=
 =?UTF-8?q?=E7=AB=99=E4=BF=A1=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/hdl/setCenter/web/hdl_basic.go | 22 +++++++---------------
 app/md/setCenter/md_web.go         |  2 ++
 app/router/router.go               |  1 +
 3 files changed, 10 insertions(+), 15 deletions(-)

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)