浏览代码

fix:加密修改

zqbao 9 月之前
父节点
当前提交
4ad0cfad38
共有 3 个文件被更改,包括 2 次插入5 次删除
  1. 1 1
      controllers/base_common.go
  2. 1 0
      utils/config.go
  3. 0 4
      utils/constants.go

+ 1 - 1
controllers/base_common.go

@@ -73,7 +73,7 @@ func (c *BaseCommonController) JSON(data interface{}, hasIndent bool, coding boo
 
 	// 数据加密
 	if services.CheckEncryption() {
-		content = utils.DesBase64Encrypt(content, utils.Key)
+		content = utils.DesBase64Encrypt(content, utils.DesKey)
 		// get请求时,不加双引号就获取不到数据,不知道什么原因,所以还是在前后加上双引号吧
 		content = []byte(`"` + string(content) + `"`)
 	}

+ 1 - 0
utils/config.go

@@ -86,6 +86,7 @@ func init() {
 	MYSQL_URL_MASTER = config["mysql_url_master"]
 
 	SMS_TPLID = config["sms_tplId"]
+	DesKey = config["des_key"]
 
 	WX_APPID = config["wx_appid"]
 	WX_APP_SECRET = config["wx_app_secret"]

+ 0 - 4
utils/constants.go

@@ -42,10 +42,6 @@ const (
 	DesKeySalt    = "odNMloUrTAmyRd9fb0TtlrPk" // DesKey盐值
 )
 
-const (
-	Key = "KcSJaJodi78LAA7HEWpaiH49" //全局加密KEY
-)
-
 const (
 	DefaultPhone    = "021-6312 3067" //默认销售电话号
 	DefaultAreaCode = "86"