f
This commit is contained in:
@@ -68,7 +68,12 @@ func (l *MobileCodeLoginLogic) MobileCodeLogin(req *types.MobileCodeLoginReq) (r
|
||||
}
|
||||
token, err := l.svcCtx.UserService.GeneralUserToken(l.ctx, userID, model.UserTypeNormal)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "手机登录, 生成token失败 : %d", userID)
|
||||
// 封禁等业务错误原样返回,便于前端展示「用户已被封禁」
|
||||
causeErr := errors.Cause(err)
|
||||
if _, ok := causeErr.(*xerr.CodeError); ok {
|
||||
return nil, err
|
||||
}
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "手机登录, 生成token失败 : %d, %v", userID, err)
|
||||
}
|
||||
|
||||
// 获取当前时间戳
|
||||
|
||||
Reference in New Issue
Block a user