|
|
@@ -219,7 +219,17 @@ func buildRedisLoginInfo(loginaccount accountModel.Loginaccount, addr string, gr
|
|
|
if client.Clients == nil {
|
|
|
client.Clients = make(map[int]*client.Client, 0)
|
|
|
}
|
|
|
- delete(client.Clients, claims.SessionID)
|
|
|
+ // 这里应该按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[claims.SessionID] = &client.Client{LoginRedis: loginLogin}
|
|
|
|
|
|
return
|
|
|
@@ -269,7 +279,6 @@ func RestoreLoginWithToken(loginID int, group int, token string) (err error) {
|
|
|
for _, k := range targetKeys {
|
|
|
delete(client.Clients, k)
|
|
|
}
|
|
|
-
|
|
|
client.Clients[s] = &client.Client{LoginRedis: loginLogin}
|
|
|
|
|
|
return
|