|
@@ -187,10 +187,15 @@ public class UserApiController extends BaseApiController {
|
|
|
}
|
|
}
|
|
|
User user = userService.selectByPrimaryKey(TokenManager.getUserId());
|
|
User user = userService.selectByPrimaryKey(TokenManager.getUserId());
|
|
|
if (mobile.equals(user.getMobile())) {
|
|
if (mobile.equals(user.getMobile())) {
|
|
|
- res.getError().add(buildError(ErrorConstants.MOBILE_SAME_ERROR, "新手机号必须和原手机号不同!"));
|
|
|
|
|
|
|
+ res.getError().add(buildError(ErrorConstants.MOBILE_SAME_ERROR));
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
- if (res.getError().isEmpty() && TokenManager.isLogin()) {
|
|
|
|
|
|
|
+ User u = userService.selectByMobieAndType(mobile, user.getType());
|
|
|
|
|
+ if (null != u){
|
|
|
|
|
+ res.getError().add(buildError(ErrorConstants.DUNPLICATE_KAY_ERROR, "", mobile));
|
|
|
|
|
+ return res;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
user.setMobile(mobile);
|
|
user.setMobile(mobile);
|
|
|
res.setData(userService.updateByPrimaryKey(user));
|
|
res.setData(userService.updateByPrimaryKey(user));
|
|
|
}
|
|
}
|