Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e30d50845a | |||
| b4cd51a6dc | |||
| dac969d798 |
@@ -30,7 +30,7 @@ func GenerateTokenAes(id uint, identity, client, role string, owner any, extend
|
|||||||
if !(JwtSecretLen == 16 || JwtSecretLen == 24 || JwtSecretLen == 32) {
|
if !(JwtSecretLen == 16 || JwtSecretLen == 24 || JwtSecretLen == 32) {
|
||||||
return "", errcode.ErrJWTSecretKey
|
return "", errcode.ErrJWTSecretKey
|
||||||
}
|
}
|
||||||
expireTime := time.Now().Add(vars.JwtExpireDay)
|
expireTime := time.Now().Add(vars.JwtExpire)
|
||||||
claims := types.JwtClaims{
|
claims := types.JwtClaims{
|
||||||
ID: id,
|
ID: id,
|
||||||
Identity: identity,
|
Identity: identity,
|
||||||
|
|||||||
@@ -4,5 +4,5 @@ import "time"
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
// cache def value
|
// cache def value
|
||||||
JwtExpireDay time.Duration = 1 * 24 * time.Hour
|
JwtExpire time.Duration = 1 * 24 * time.Hour
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -5,4 +5,6 @@ const (
|
|||||||
NormalStatus = 1
|
NormalStatus = 1
|
||||||
// DisabledStatus .
|
// DisabledStatus .
|
||||||
DisabledStatus = -1
|
DisabledStatus = -1
|
||||||
|
|
||||||
|
OK string = "OK"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user