by Robin at 20240613

This commit is contained in:
Leufolium 2024-06-13 17:07:57 +08:00
parent 601b8a5888
commit b6441121fb
1 changed files with 10 additions and 14 deletions

View File

@ -81,13 +81,11 @@ func (s *Service) ApiLoginByPswd(ctx *gin.Context, req *loginproto.ApiLoginByPsw
// 2.让已登录的用户强制下线
if account.GetRole() == consts.User {
if util.DerefInt64(login.IsLogined) == 1 {
if _, ec = s.ApiLogout(ctx, &loginproto.ApiLogoutReq{
Mid: account.Mid,
}); ec != errcode.ErrCodeLoginSrvOk {
logger.Error("ApiLogout failed!")
return
}
if _, ec = s.ApiLogout(ctx, &loginproto.ApiLogoutReq{
Mid: account.Mid,
}); ec != errcode.ErrCodeLoginSrvOk {
logger.Error("ApiLogout failed!")
return
}
}
@ -158,13 +156,11 @@ func (s *Service) ApiLoginByVeriCode(ctx *gin.Context, req *loginproto.ApiLoginB
// 4.让已登录的用户强制下线
if account.GetRole() == consts.User {
if util.DerefInt64(login.IsLogined) == 1 {
if _, ec = s.ApiLogout(ctx, &loginproto.ApiLogoutReq{
Mid: account.Mid,
}); ec != errcode.ErrCodeLoginSrvOk {
logger.Error("ApiLogout failed!")
return
}
if _, ec = s.ApiLogout(ctx, &loginproto.ApiLogoutReq{
Mid: account.Mid,
}); ec != errcode.ErrCodeLoginSrvOk {
logger.Error("ApiLogout failed!")
return
}
}