|
@@ -129,12 +129,17 @@ public class AuthController extends ControllerSupport {
|
|
User accessUser = getAccessUser();
|
|
User accessUser = getAccessUser();
|
|
Long studentId = accessUser.getStudentId();
|
|
Long studentId = accessUser.getStudentId();
|
|
|
|
|
|
- if (null != studentId) {
|
|
|
|
- Student s = studentRepo.findOne(studentId);
|
|
|
|
- s.setSecurityPhone(phone);
|
|
|
|
- } else {
|
|
|
|
- throw new StatusException("B-001051", "绑定失败");
|
|
|
|
|
|
+ Student sb = studentRepo.findBySecurityPhone(phone);
|
|
|
|
+ if (null != sb) {
|
|
|
|
+ if (!sb.getId().equals(studentId)) {
|
|
|
|
+ throw new StatusException("B-001052", "手机号已被其他用户绑定,请更换手机号");
|
|
|
|
+ } else {
|
|
|
|
+ throw new StatusException("B-001053", "手机号已绑定成功,无需重复绑定");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ Student s = studentRepo.findOne(studentId);
|
|
|
|
+ s.setSecurityPhone(phone);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|