Merge pull request 'by Robin at 20240326' (#205) from feat-IRONFANS-ALTER-Robin into main
Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/205
This commit is contained in:
commit
4f8ed5742e
|
@ -6,14 +6,14 @@ import (
|
||||||
"service/app/mix/service"
|
"service/app/mix/service"
|
||||||
"service/bizcommon/util"
|
"service/bizcommon/util"
|
||||||
"service/library/logger"
|
"service/library/logger"
|
||||||
|
"service/library/mediafiller"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ApiLoginByPswd(ctx *gin.Context) {
|
func ApiLoginByPswd(ctx *gin.Context) {
|
||||||
req := ctx.MustGet("client_req").(*loginproto.ApiLoginByPswdReq)
|
req := ctx.MustGet("client_req").(*loginproto.ApiLoginByPswdReq)
|
||||||
//isEnabled, token, accountVO, ec := service.DefaultService.ApiLoginByPswd(ctx, req)
|
isEnabled, token, accountVO, ec := service.DefaultService.ApiLoginByPswd(ctx, req)
|
||||||
ec := errcode.ErrCodeSuspend
|
|
||||||
if ec != errcode.ErrCodeLoginSrvOk {
|
if ec != errcode.ErrCodeLoginSrvOk {
|
||||||
logger.Error("ApiLoginByPswd fail, req: %v, ec: %v", util.ToJson(req), ec)
|
logger.Error("ApiLoginByPswd fail, req: %v, ec: %v", util.ToJson(req), ec)
|
||||||
ReplyErrCodeMsg(ctx, ec)
|
ReplyErrCodeMsg(ctx, ec)
|
||||||
|
@ -21,13 +21,13 @@ func ApiLoginByPswd(ctx *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//填充媒体切片
|
//填充媒体切片
|
||||||
// mediafiller.FillEntity(ctx, accountVO.Avatar)
|
mediafiller.FillEntity(ctx, accountVO.Avatar)
|
||||||
|
|
||||||
// ReplyOk(ctx, &loginproto.ApiLoginData{
|
ReplyOk(ctx, &loginproto.ApiLoginData{
|
||||||
// IsEnabled: isEnabled,
|
IsEnabled: isEnabled,
|
||||||
// Token: token,
|
Token: token,
|
||||||
// AccountVO: accountVO,
|
AccountVO: accountVO,
|
||||||
// })
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,5 @@ func ApiLogout(ctx *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func ApiValidate(ctx *gin.Context) {
|
func ApiValidate(ctx *gin.Context) {
|
||||||
ec := errcode.ErrCodeSuspend
|
ReplyOk(ctx, nil)
|
||||||
ReplyErrCodeMsg(ctx, ec)
|
|
||||||
//ReplyOk(ctx, nil)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,6 +76,12 @@ func (s *Service) ApiLoginByPswd(ctx *gin.Context, req *loginproto.ApiLoginByPsw
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 20240326整改临时调整
|
||||||
|
if util.DerefInt64(account.Status) != consts.Admin && util.DerefInt64(account.Status) != consts.Supportor {
|
||||||
|
ec = errcode.ErrCodeSuspend
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// 2.让已登录的用户强制下线
|
// 2.让已登录的用户强制下线
|
||||||
if util.DerefInt64(login.IsLogined) == 1 {
|
if util.DerefInt64(login.IsLogined) == 1 {
|
||||||
if _, ec = s.ApiLogout(ctx, &loginproto.ApiLogoutReq{
|
if _, ec = s.ApiLogout(ctx, &loginproto.ApiLogoutReq{
|
||||||
|
|
Loading…
Reference in New Issue