refactor(用户绑定): 移除设备绑定数量上限校验逻辑
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 6m56s
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 6m56s
简化邮箱绑定流程,直接绑定邮箱而不检查设备数量限制
This commit is contained in:
parent
471c84eb1c
commit
109f708652
@ -104,15 +104,7 @@ func (l *BindEmailWithVerificationLogic) BindEmailWithVerification(req *types.Bi
|
||||
var emailUserId int64
|
||||
if err != nil {
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
// 邮箱不存在,准备绑定到当前设备用户
|
||||
// 设备绑定数量上限校验
|
||||
if limit := l.svcCtx.SessionLimit(); limit > 0 {
|
||||
if _, count, cntErr := l.svcCtx.UserModel.QueryDeviceList(l.ctx, u.Id); cntErr == nil {
|
||||
if count >= limit {
|
||||
return nil, xerr.NewErrCodeMsg(xerr.DeviceBindLimitExceeded, "账户绑定设备数已达上限,请移除其他设备后再登录,您也可以再注册一个新账户使用,点击帮助中心查看更多详情。")
|
||||
}
|
||||
}
|
||||
}
|
||||
// 邮箱不存在,绑定邮箱认证到当前设备用户(不增加设备数量)
|
||||
l.Infow(" 为当前设备做 邮箱绑定操作; 在 user_auth_methods 中添加记录", logger.Field("email", req.Email))
|
||||
err = l.addAuthMethodForEmailUser(u.Id, req.Email)
|
||||
if err != nil {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user