重复登录的断开连接
This commit is contained in:
@@ -81,6 +81,7 @@ func (wm *ChannelManager) LoginSuccess(UID, name, tp string) error {
|
|||||||
//判断是否重复登录
|
//判断是否重复登录
|
||||||
for _, v := range wm.User {
|
for _, v := range wm.User {
|
||||||
if v.UserName == name && v.AlarmType == tp && v.LoginState {
|
if v.UserName == name && v.AlarmType == tp && v.LoginState {
|
||||||
|
v.Conn.Stop()
|
||||||
return errors.New("repeat login for the account")
|
return errors.New("repeat login for the account")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user