feat: 数据库引用变更
This commit is contained in:
@@ -8,8 +8,8 @@ import (
|
||||
"be.ems/src/framework/config"
|
||||
cachekeyConstants "be.ems/src/framework/constants/cachekey"
|
||||
tokenConstants "be.ems/src/framework/constants/token"
|
||||
redisCahe "be.ems/src/framework/database/redis"
|
||||
"be.ems/src/framework/logger"
|
||||
redisCahe "be.ems/src/framework/redis"
|
||||
"be.ems/src/framework/utils/generate"
|
||||
"be.ems/src/framework/utils/machine"
|
||||
"be.ems/src/framework/vo"
|
||||
@@ -28,7 +28,7 @@ func Remove(tokenStr string) string {
|
||||
uuid := claims[tokenConstants.JWT_UUID].(string)
|
||||
tokenKey := cachekeyConstants.LOGIN_TOKEN_KEY + uuid
|
||||
hasKey, _ := redisCahe.Has("", tokenKey)
|
||||
if hasKey {
|
||||
if hasKey > 0 {
|
||||
redisCahe.Del("", tokenKey)
|
||||
}
|
||||
return claims[tokenConstants.JWT_NAME].(string)
|
||||
@@ -141,7 +141,7 @@ func LoginUser(claims jwt.MapClaims) vo.LoginUser {
|
||||
tokenKey := cachekeyConstants.LOGIN_TOKEN_KEY + uuid
|
||||
hasKey, _ := redisCahe.Has("", tokenKey)
|
||||
var loginUser vo.LoginUser
|
||||
if hasKey {
|
||||
if hasKey > 0 {
|
||||
loginUserStr, _ := redisCahe.Get("", tokenKey)
|
||||
if loginUserStr == "" {
|
||||
return loginUser
|
||||
|
||||
Reference in New Issue
Block a user