feat:完善项目信息

This commit is contained in:
henry
2022-01-04 11:59:58 +08:00
parent c3da1ebc51
commit e29371da3e
20 changed files with 357 additions and 62 deletions

View File

@ -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("登陆错误,用户未登录或已退出")