浏览代码

Merge branch 'logo' into debug

# Conflicts:
#	controllers/user_login.go
#	routers/commentsRouter.go
zwxi 11 月之前
父节点
当前提交
5cc546b51e
共有 2 个文件被更改,包括 59 次插入16 次删除
  1. 50 7
      controllers/user_login.go
  2. 9 9
      routers/commentsRouter.go

+ 50 - 7
controllers/user_login.go

@@ -975,12 +975,12 @@ func (this *UserLoginController) CheckUserLdap() {
 	br.Msg = "操作成功"
 }
 
-// ICPLicense
-// @Title icp备案信息
-// @Description icp备案信息
+// BaseInfo
+// @Title 基础信息
+// @Description 基础信息
 // @Success 200 Ret=200 获取成功
-// @router /icp_license [get]
-func (this *UserLoginController) ICPLicense() {
+// @router /base_info [get]
+func (this *UserLoginController) BaseInfo() {
 	br := new(models.BaseResponse).Init()
 	defer func() {
 		if br.ErrMsg == "" {
@@ -990,15 +990,58 @@ func (this *UserLoginController) ICPLicense() {
 		this.ServeJSON()
 	}()
 
+	icp, e := models.GetBusinessConfByKey("ICPLicense")
+	if e != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取商家配置失败, Err: " + e.Error()
+		return
+	}
+
+	title, e := models.GetBusinessConfByKey("ETATitle")
+	if e != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取商家配置失败, Err: " + e.Error()
+		return
+	}
+
+	tabNameMobile, e := models.GetBusinessConfByKey("TabNameMobile")
+	if e != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取商家配置失败, Err: " + e.Error()
+		return
+	}
+
+	logoCn, e := models.GetBusinessConfByKey("LogoCN")
+	if e != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取商家配置失败, Err: " + e.Error()
+		return
+	}
 
-	item, e := models.GetBusinessConfByKey("ICPLicense")
+	logoEn, e := models.GetBusinessConfByKey("LogoEN")
 	if e != nil {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取商家配置失败, Err: " + e.Error()
 		return
 	}
 
-	br.Data = item
+	type BaseInfoResp struct {
+		Icp           *models.BusinessConf `description:"Icp信息"`
+		ETATitle      *models.BusinessConf `description:"eta系统名称"`
+		TabNameMobile *models.BusinessConf `description:"tab页名称"`
+		logoCn        *models.BusinessConf `description:"中文logo"`
+		logoEn        *models.BusinessConf `description:"英文logo"`
+	}
+
+	resp := BaseInfoResp{
+		Icp:           icp,
+		ETATitle:      title,
+		TabNameMobile: tabNameMobile,
+		logoCn:        logoCn,
+		logoEn:        logoEn,
+	}
+
+	br.Data = resp
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "获取成功"

+ 9 - 9
routers/commentsRouter.go

@@ -6100,6 +6100,15 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["eta/eta_mobile/controllers:UserLoginController"] = append(beego.GlobalControllerRouter["eta/eta_mobile/controllers:UserLoginController"],
+        beego.ControllerComments{
+            Method: "BaseInfo",
+            Router: `/base_info`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["eta/eta_mobile/controllers:UserLoginController"] = append(beego.GlobalControllerRouter["eta/eta_mobile/controllers:UserLoginController"],
         beego.ControllerComments{
             Method: "ForgetAccountGet",
@@ -6144,15 +6153,6 @@ func init() {
             MethodParams: param.Make(),
             Filters: nil,
             Params: nil})
-            
-    beego.GlobalControllerRouter["eta/eta_mobile/controllers:UserLoginController"] = append(beego.GlobalControllerRouter["eta/eta_mobile/controllers:UserLoginController"],
-        beego.ControllerComments{
-            Method: "ICPLicense",
-            Router: `/icp_license`,
-            AllowHTTPMethods: []string{"get"},
-            MethodParams: param.Make(),
-            Filters: nil,
-            Params: nil})
 
     beego.GlobalControllerRouter["eta/eta_mobile/controllers:UserLoginController"] = append(beego.GlobalControllerRouter["eta/eta_mobile/controllers:UserLoginController"],
         beego.ControllerComments{