改变路由层级,模块化

This commit is contained in:
2023-01-18 15:40:27 +08:00
parent bd25f041a2
commit 0f8c1f989b
102 changed files with 335 additions and 322 deletions
+24
View File
@@ -0,0 +1,24 @@
package cache
import (
"cutego/pkg/cache"
"cutego/pkg/config"
"cutego/pkg/constant"
)
// SetRedisToken 将token存入到redis
// @Param username string 用户名
// @Param token string token令牌
func SetRedisToken(username string, token string) {
if config.AppEnvConfig.Login.Single {
cache.SetCacheTTL(constant.RedisOnlineUserKey+username, token, 3600)
}
}
// RemoveRedisToken 将token从redis中删除
// @Param username string 用户名
// @Return 删除的行数
func RemoveRedisToken(username string) int {
// 不管是不是单点登录, 直接踢
return cache.RemoveCache(constant.RedisOnlineUserKey + username)
}