手机号授权:重置密码操作区分主客态
This commit is contained in:
@@ -420,7 +420,7 @@ public class AccountManageService {
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
*
|
||||
* 两个场景调用 => 客户端未登录 忘记密码, 此时uid 为 null 登录状态下忘记密码 uid有值
|
||||
* @param uid
|
||||
* @param phone
|
||||
* @param password
|
||||
@@ -428,15 +428,8 @@ 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)) {
|
||||
if (null == account || (uid != null && !account.getUid().equals(uid)) ) {
|
||||
return OAuthStatus.PHONE_BIND_ERROR;
|
||||
}
|
||||
//检验验证码
|
||||
|
@@ -298,6 +298,9 @@ public class AccountController extends BaseController {
|
||||
return new ServiceRes(OAuthStatus.USER_NOT_EXISTED);
|
||||
}
|
||||
phone = account.getPhone();
|
||||
if (!CommonUtil.checkPhoneFormat(account.getPhoneAreaCode(),account.getPhone())) {
|
||||
return OAuthStatus.ACCOUNT_NOT_BIND_PHONE;
|
||||
}
|
||||
}
|
||||
int count = accountService.countByPhone(phone);
|
||||
if(count > 1) {
|
||||
|
Reference in New Issue
Block a user