Compare commits

...

2 Commits

Author SHA1 Message Date
zhaoxiaorong
8d8ec866cd GenerateTokenAes 获取JwtSecretLen 2025-02-11 11:56:48 +08:00
zhaoxiaorong
d8e54f4909 fix 2025-02-11 11:06:35 +08:00
2 changed files with 3 additions and 2 deletions

View File

@@ -27,7 +27,8 @@ func New(token string) {
}
func GenerateTokenAes(id uint, identity, client, role string, owner any, extend map[string]string) (string, error) {
if (JwtSecretLen == 16 || JwtSecretLen == 24 || JwtSecretLen == 32) == false {
JwtSecretLen = len(env.Runtime.JwtSecretKey)
if JwtSecretLen == 16 || JwtSecretLen == 24 || JwtSecretLen == 32 {
return "", errcode.ErrJWTSecretKey
}
expireTime := time.Now().Add(vars.JwtExpireDay)

View File

@@ -5,7 +5,7 @@ import (
"google.golang.org/grpc/status"
)
var Response *Reply
var Response Reply
type Reply struct {
Code int `json:"code"`