From b6441121fbcebe710da6221d04a0ffad2ef4e075 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Thu, 13 Jun 2024 17:07:57 +0800 Subject: [PATCH] by Robin at 20240613 --- app/mix/service/apiservice.go | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/app/mix/service/apiservice.go b/app/mix/service/apiservice.go index fce03e88..1aa4d3b7 100644 --- a/app/mix/service/apiservice.go +++ b/app/mix/service/apiservice.go @@ -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 } }