Merge pull request 'by Robin at 20240613' (#531) from feat-IRONFANS-122-Robin into test

Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/531
This commit is contained in:
chenhao 2024-06-13 13:21:00 +08:00
commit 136f96fdf5
1 changed files with 16 additions and 12 deletions

View File

@ -82,12 +82,14 @@ func (s *Service) ApiLoginByPswd(ctx *gin.Context, req *loginproto.ApiLoginByPsw
}
// 2.让已登录的用户强制下线
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 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
}
}
}
@ -157,12 +159,14 @@ func (s *Service) ApiLoginByVeriCode(ctx *gin.Context, req *loginproto.ApiLoginB
}
// 4.让已登录的用户强制下线
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 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
}
}
}