feat: 数据库引用变更

This commit is contained in:
TsMask
2025-04-22 14:30:05 +08:00
parent af4d2b70cc
commit 55b6aa348b
32 changed files with 1546 additions and 348 deletions

View File

@@ -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