by Robin at 20240613
This commit is contained in:
parent
601b8a5888
commit
b6441121fb
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue