|
@@ -2,7 +2,9 @@ package controllers
|
|
|
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
+ "fmt"
|
|
|
"hongze/hz_eta_api/models"
|
|
|
+ "hongze/hz_eta_api/utils"
|
|
|
"html"
|
|
|
"strconv"
|
|
|
"strings"
|
|
@@ -193,3 +195,36 @@ func (this *BusinessConfController) Fetch() {
|
|
|
br.Success = true
|
|
|
br.Msg = "获取成功"
|
|
|
}
|
|
|
+
|
|
|
+// CodeEncrypt
|
|
|
+// @Title 商家编码加密
|
|
|
+// @Description 商家编码加密
|
|
|
+// @Success 200 Ret=200 获取成功
|
|
|
+// @router /code_encrypt [get]
|
|
|
+func (this *BusinessConfController) CodeEncrypt() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ if br.ErrMsg == "" {
|
|
|
+ br.IsSendEmail = false
|
|
|
+ }
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+ sysUser := this.SysUser
|
|
|
+ if sysUser == nil {
|
|
|
+ br.Msg = "请登录"
|
|
|
+ br.ErrMsg = "请登录,SysUser Is Empty"
|
|
|
+ br.Ret = 408
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ res := ""
|
|
|
+ if utils.BusinessCode != "" {
|
|
|
+ res = utils.MD5(fmt.Sprintf("%s%s", utils.BusinessCode, utils.BusinessCodeSalt))
|
|
|
+ }
|
|
|
+
|
|
|
+ br.Data = res
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+}
|