feat:完善项目信息
This commit is contained in:
@ -15,7 +15,7 @@ type AuthToken struct {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
func (this *AuthToken) Auth(session logic.ISession) error {
|
||||
func (this *AuthToken) Auth(key string, session logic.ISession) error {
|
||||
tokenInfo := utils.JWTDecrypt(this.Token)
|
||||
|
||||
if tokenInfo == nil || len(tokenInfo) <= 0 {
|
||||
@ -28,7 +28,7 @@ func (this *AuthToken) Auth(session logic.ISession) error {
|
||||
if !ok {
|
||||
return errors.New("登陆错误,Token过期")
|
||||
}
|
||||
cache, _ := cache2.Cache.HGet(config.RedisKeyForAccount, fmt.Sprintf("%v", tokenInfo[config.TokenForUID]))
|
||||
cache, _ := cache2.Cache.HGet(key, fmt.Sprintf("%v", tokenInfo[config.TokenForUID]))
|
||||
|
||||
if cache == "" {
|
||||
return errors.New("登陆错误,用户未登录或已退出")
|
||||
|
Reference in New Issue
Block a user