diff --git a/src/lib_features/account/account.go b/src/lib_features/account/account.go index 2bdfd8fc..9e4e5eaf 100644 --- a/src/lib_features/account/account.go +++ b/src/lib_features/account/account.go @@ -14,7 +14,13 @@ import ( func SessionToken(username, sourceAddr string) bool { token, _ := redis.Get("", "session_token") if token != "" { - return true + se, err := dborm.XormUpdateSessionShakeTime(token) + if se.AccountId != username || err != nil { + // 过期时间单位秒 配置1800是半小时 + expireTime := time.Duration(int64(libConfig.GetExpiresFromConfig())) * time.Second + redis.SetByExpire("", "session_token", token, expireTime) + return true + } } token = oauth.GenRandToken("omc") // Generate new token to session ID