by Robin at 20240613 #531
|
@ -80,6 +80,7 @@ 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,
|
||||
|
@ -88,6 +89,7 @@ func (s *Service) ApiLoginByPswd(ctx *gin.Context, req *loginproto.ApiLoginByPsw
|
|||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 3.生成token
|
||||
token, err := _DefaultToken.OpGenerate(ctx, &tokenproto.OpCreateReq{
|
||||
|
@ -155,6 +157,7 @@ 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,
|
||||
|
@ -163,6 +166,7 @@ func (s *Service) ApiLoginByVeriCode(ctx *gin.Context, req *loginproto.ApiLoginB
|
|||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 5.生成token
|
||||
token, err = _DefaultToken.OpGenerate(ctx, &tokenproto.OpCreateReq{
|
||||
|
|
Loading…
Reference in New Issue