ting.yin 8 anos atrás
pai
commit
ba47c9d97a

+ 3 - 5
core-api/src/main/java/cn/com/qmth/examcloud/service/core/service/StudentService.java

@@ -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());

+ 2 - 4
core-api/src/main/java/cn/com/qmth/examcloud/service/core/service/UserService.java

@@ -118,11 +118,9 @@ public class UserService {
     public ResponseEntity loginProcess(User user,
                                        String password){
         if(user == null){
-        	new RuntimeException("该用户不存在");
-            return null;
+        	throw new RuntimeException("该用户不存在");
         }else if(!user.getPassword().equals(password)){
-        	new RuntimeException("密码错误");
-            return null;
+        	throw new RuntimeException("密码错误");
         }else{
             String token = AccessCtrlUtil.buildToken();
             createAccessUser(token,user,null);