zwxi 10 months ago
parent
commit
bd4e824072
1 changed files with 51 additions and 7 deletions
  1. 51 7
      controllers/user_login.go

+ 51 - 7
controllers/user_login.go

@@ -986,12 +986,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 == "" {
@@ -1001,14 +1001,58 @@ func (this *UserLoginController) ICPLicense() {
 		this.ServeJSON()
 	}()
 
-	item, e := models.GetBusinessConfByKey("ICPLicense")
+	icp, e := models.GetBusinessConfByKey("ICPLicense")
 	if e != nil {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取商家配置失败, Err: " + e.Error()
 		return
 	}
 
-	br.Data = item
+	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
+	}
+
+	logoEn, e := models.GetBusinessConfByKey("LogoEN")
+	if e != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取商家配置失败, Err: " + e.Error()
+		return
+	}
+
+	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 = "获取成功"