deason 1 year ago
parent
commit
aa1a2dc69a

+ 3 - 3
src/main/java/com/qmth/exam/reserve/service/impl/AuthServiceImpl.java

@@ -72,7 +72,7 @@ public class AuthServiceImpl implements AuthorizationService<LoginUser>, AuthSer
         log.debug("[USER_LOGIN] verifying... account:{} orgId:{}", req.getAccount(), req.getOrgId());
         log.debug("[USER_LOGIN] verifying... account:{} orgId:{}", req.getAccount(), req.getOrgId());
         UserEntity user = userService.findUserByLoginName(req.getOrgId(), req.getAccount());
         UserEntity user = userService.findUserByLoginName(req.getOrgId(), req.getAccount());
         if (user == null) {
         if (user == null) {
-            throw new StatusException("登录用户不存在");
+            throw new StatusException("登录账号或密码错误");
         }
         }
 
 
         String encodePassword = DigestUtils.sha256Hex(req.getPassword()).toUpperCase();
         String encodePassword = DigestUtils.sha256Hex(req.getPassword()).toUpperCase();
@@ -121,7 +121,7 @@ public class AuthServiceImpl implements AuthorizationService<LoginUser>, AuthSer
         log.debug("[STUDENT_LOGIN] verifying... account:{} orgId:{}", req.getAccount(), req.getOrgId());
         log.debug("[STUDENT_LOGIN] verifying... account:{} orgId:{}", req.getAccount(), req.getOrgId());
         StudentEntity student = studentService.findByStudentCode(curApplyTask.getTaskId(), req.getAccount());
         StudentEntity student = studentService.findByStudentCode(curApplyTask.getTaskId(), req.getAccount());
         if (student == null) {
         if (student == null) {
-            throw new StatusException("登录用户不存在");
+            throw new StatusException("登录账号或密码错误");
         }
         }
 
 
         String encodePassword = DigestUtils.sha256Hex(req.getPassword()).toUpperCase();
         String encodePassword = DigestUtils.sha256Hex(req.getPassword()).toUpperCase();
@@ -156,7 +156,7 @@ public class AuthServiceImpl implements AuthorizationService<LoginUser>, AuthSer
         log.debug("[WECHAT_LOGIN] verifying... openId:{} uid:{}", req.getOpenId(), req.getUid());
         log.debug("[WECHAT_LOGIN] verifying... openId:{} uid:{}", req.getOpenId(), req.getUid());
         StudentEntity student = studentService.findByOpenIdAndUid(req.getOpenId(), req.getUid());
         StudentEntity student = studentService.findByOpenIdAndUid(req.getOpenId(), req.getUid());
         if (student == null) {
         if (student == null) {
-            throw new StatusException("登录用户不存在");
+            throw new StatusException("尚未绑定微信账号");
         }
         }
 
 
         ApplyTaskEntity curApplyTask = applyTaskService.getLessInfoApplyTaskById(student.getApplyTaskId());
         ApplyTaskEntity curApplyTask = applyTaskService.getLessInfoApplyTaskById(student.getApplyTaskId());

+ 10 - 2
src/main/java/com/qmth/exam/reserve/service/impl/ExamReserveServiceImpl.java

@@ -169,7 +169,11 @@ public class ExamReserveServiceImpl implements ExamReserveService {
                 throw new StatusException("预约失败,请稍后再试!", e);
                 throw new StatusException("预约失败,请稍后再试!", e);
             }
             }
         } finally {
         } finally {
-            studentApplyLock.unlock();
+            try {
+                studentApplyLock.unlock();
+            } catch (Exception e) {
+                log.warn(e.getMessage());
+            }
         }
         }
     }
     }
 
 
@@ -243,7 +247,11 @@ public class ExamReserveServiceImpl implements ExamReserveService {
 
 
             // todo 取消预约事件
             // todo 取消预约事件
         } finally {
         } finally {
-            studentApplyLock.unlock();
+            try {
+                studentApplyLock.unlock();
+            } catch (Exception e) {
+                log.warn(e.getMessage());
+            }
         }
         }
     }
     }