From f1310d093ed27b1c8f2d89655717a71f1ee0a830 Mon Sep 17 00:00:00 2001 From: zhaoxiaorong Date: Tue, 11 Feb 2025 13:19:07 +0800 Subject: [PATCH] fix --- crypto/encipher/encipher.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto/encipher/encipher.go b/crypto/encipher/encipher.go index 90a80a5..873418e 100644 --- a/crypto/encipher/encipher.go +++ b/crypto/encipher/encipher.go @@ -21,13 +21,13 @@ var ( JwtSecretLen int ) -func New(token string) { - JwtSecret = []byte(token) +func New(secret string) { + JwtSecret = []byte(secret) JwtSecretLen = len(env.Runtime.JwtSecretKey) } func GenerateTokenAes(id uint, identity, client, role string, owner any, extend map[string]string) (string, error) { - if (JwtSecretLen == 16 || JwtSecretLen == 24 || JwtSecretLen == 32) == false { + if !(JwtSecretLen == 16 || JwtSecretLen == 24 || JwtSecretLen == 32) { return "", errcode.ErrJWTSecretKey } expireTime := time.Now().Add(vars.JwtExpireDay)