重复登录的断开连接

This commit is contained in:
TsMask
2023-08-24 19:11:12 +08:00
parent 02a2dd7a7a
commit 7377143dd5

View File

@@ -81,6 +81,7 @@ func (wm *ChannelManager) LoginSuccess(UID, name, tp string) error {
//判断是否重复登录
for _, v := range wm.User {
if v.UserName == name && v.AlarmType == tp && v.LoginState {
v.Conn.Stop()
return errors.New("repeat login for the account")
}
}