From 8e86d36805c447db8bcc09d7a81b37dd328c839d Mon Sep 17 00:00:00 2001 From: hujiebin Date: Sun, 25 Jun 2023 11:18:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- route/middleHandle.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/route/middleHandle.go b/route/middleHandle.go index ddc26fa..347db77 100755 --- a/route/middleHandle.go +++ b/route/middleHandle.go @@ -5,6 +5,7 @@ import ( "git.hilo.cn/hilo-common/mycontext" "git.hilo.cn/hilo-common/mylogrus" "git.hilo.cn/hilo-common/resource/config" + "git.hilo.cn/hilo-common/utils" "github.com/gin-gonic/gin" "hilo-user/myerr/bizerr" "hilo-user/req" @@ -136,6 +137,11 @@ func LoggerHandle(c *gin.Context) { // 加密Handle func EncryptHandle(c *gin.Context) { - c.Set(mycontext.InnerEncrypt, true) + if value, ok := c.Get(mycontext.APP_VERSION); ok { + if high, _ := utils.CompareVersion(value.(string), "> 3.9.0"); high { + c.Set(mycontext.InnerEncrypt, true) + } + } + c.Set(mycontext.InnerEncrypt, true) // todo 后面版本判断去掉 c.Next() } -- 2.22.0