feat: user update mobile
This commit is contained in:
@@ -75,6 +75,14 @@ func (l *UpdateLogic) Update(in *user.UpdateReq) (*user.Response, error) {
|
||||
return failResponse(utils.ErrorEncryptAesError), nil
|
||||
}
|
||||
if enc != row.Mobile {
|
||||
ok, verifyErr := verifyAndConsumeSmsCode(l.ctx, dao.SmsSceneRebindMobile, req.Mobile, req.SmsCode)
|
||||
if verifyErr != nil {
|
||||
l.Errorf("update verify sms: %v", verifyErr)
|
||||
return failResponse(utils.Fail), nil
|
||||
}
|
||||
if !ok {
|
||||
return outResponse(utils.ErrorParams, "验证码错误或已过期"), nil
|
||||
}
|
||||
occupied, occErr := findUserByMobile(enc)
|
||||
if occErr != nil {
|
||||
l.Errorf("update mobile unique: %v", occErr)
|
||||
|
||||
Reference in New Issue
Block a user