|
@@ -152,7 +152,7 @@ public class StudentService {
|
|
|
String password, LoginType loginType) {
|
|
|
Org org = orgRepo.findByParentIdAndCode((long) 0, orgId);
|
|
|
if (org == null) {
|
|
|
- new RuntimeException("学校不存在");
|
|
|
+ throw new RuntimeException("学校不存在");
|
|
|
}
|
|
|
Student student = null;
|
|
|
if (LoginType.STUDENT_CODE.equals(loginType)) {
|
|
@@ -169,11 +169,9 @@ public class StudentService {
|
|
|
|
|
|
private ResponseEntity<?> loginProcess(Student student, String password) {
|
|
|
if (student.getUser() == null) {
|
|
|
- new RuntimeException("该用户不存在");
|
|
|
- return null;
|
|
|
+ throw new RuntimeException("该用户不存在");
|
|
|
} else if (!student.getUser().getPassword().equals(password)) {
|
|
|
- new RuntimeException("密码错误");
|
|
|
- return null;
|
|
|
+ throw new RuntimeException("密码错误");
|
|
|
} else {
|
|
|
String token = AccessCtrlUtil.buildToken();
|
|
|
userService.createAccessUser(token, student.getUser(), student.getId());
|