手机号授权: 重置密码相关toast提示

This commit is contained in:
lzm
2022-12-01 16:17:20 +08:00
committed by yeungchihang
parent a0937470d3
commit 591a932517
2 changed files with 11 additions and 1 deletions

View File

@@ -142,6 +142,9 @@ public enum OAuthStatus {
ACCOUNT_CANCEL_INFO_NOT_EXIST(3010, "獲取不到賬號註銷信息"),
PWD_WRONG_OVER_LIMIT(3011, "密碼錯誤次數過多請10分鐘后重試"),
PHONE_BIND_ERROR(3012, "绑定手机号错误,请重新输入"),
ACCOUNT_NOT_BIND_PHONE(3013, "未绑定手机号"),
;

View File

@@ -428,9 +428,16 @@ public class AccountManageService {
* @return 1:成功 2重置码无效 3用户不存在
*/
public OAuthStatus resetPasswordByResetCode(Long uid, String phone, String password, String resetCode) throws Exception {
Account accountUser = accountService.getById(uid);
if (accountUser == null) {
return OAuthStatus.USER_NOT_EXISTED;
}
if (!CommonUtil.checkPhoneFormat(accountUser.getPhoneAreaCode(),accountUser.getPhone())) {
return OAuthStatus.ACCOUNT_NOT_BIND_PHONE;
}
Account account = accountService.getAccountByPhone(phone);
if (null == account || !account.getUid().equals(uid)) {
return OAuthStatus.USER_NOT_EXISTED;
return OAuthStatus.PHONE_BIND_ERROR;
}
//检验验证码
if (accountService.verifySmsCodeByCache(phone, resetCode,account.getUid())) {