|
|
@@ -258,7 +258,18 @@ func RestoreLoginWithToken(loginID int, group int, token string) (err error) {
|
|
|
global.M2A_LOG.Error("Token检验恢复登录状态失败", zap.Error(err))
|
|
|
return
|
|
|
}
|
|
|
- delete(client.Clients, s)
|
|
|
+ // 这里应该按loginid和group把之前的client删除掉
|
|
|
+ // delete(client.Clients, s)
|
|
|
+ targetKeys := make([]int, 0)
|
|
|
+ for key, item := range client.Clients {
|
|
|
+ if item.LoginID == loginLogin.LoginID && item.Group == loginLogin.Group {
|
|
|
+ targetKeys = append(targetKeys, key)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for _, k := range targetKeys {
|
|
|
+ delete(client.Clients, k)
|
|
|
+ }
|
|
|
+
|
|
|
client.Clients[s] = &client.Client{LoginRedis: loginLogin}
|
|
|
|
|
|
return
|