From 11d649cfc3c7c0d1e8a255411a2b63ca2551b4ce Mon Sep 17 00:00:00 2001 From: coward Date: Fri, 12 Jul 2024 11:38:02 +0800 Subject: [PATCH] =?UTF-8?q?:art:jwt=E5=AF=86=E9=92=A5=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E9=9A=8F=E6=9C=BA=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/jwt.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/component/jwt.go b/component/jwt.go index 2ec4315..99e84d6 100644 --- a/component/jwt.go +++ b/component/jwt.go @@ -103,7 +103,8 @@ func (JwtComponent) ParseToken(token, secret string) (*JwtComponent, error) { func (JwtComponent) GenerateSecret(secret ...string) string { // 添加10个元素,增加随机性 for i := 0; i <= 10; i++ { - secret = append(secret, uuid.NewString() + secret = append(secret, uuid.NewString()) + } // 混淆一下明文secret的顺序 n := len(secret) for i := n - 1; i > 0; i-- {