Selaa lähdekoodia

修复考生构造sessionId时使用的字段错误

luoshi 4 vuotta sitten
vanhempi
commit
c8deec34a8

+ 2 - 2
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeInvigilateCallMobileController.java

@@ -266,7 +266,7 @@ public class TIeInvigilateCallMobileController {
         if (Objects.nonNull(ec.getMonitorAudioEnable())) {
             if (ec.getMonitorAudioEnable()) {
                 for (Source s : Source.values()) {
-                    String sessionId = SessionUtil.digest(examStudentCacheBean.getIdentity(),
+                    String sessionId = SessionUtil.digest(examStudentCacheBean.getStudentId(),
                             Math.abs(Sets.newHashSet(RoleEnum.STUDENT.name()).toString().hashCode()), s.name());
                     TBSession tbSessionClient = (TBSession) redisUtil.getUserSession(sessionId);
                     if (Objects.nonNull(tbSessionClient) && tbSessionClient.getExpireTime() > System.currentTimeMillis()
@@ -287,7 +287,7 @@ public class TIeInvigilateCallMobileController {
                 }
             } else {
                 for (Source s : Source.values()) {
-                    String sessionId = SessionUtil.digest(examStudentCacheBean.getIdentity(),
+                    String sessionId = SessionUtil.digest(examStudentCacheBean.getStudentId(),
                             Math.abs(Sets.newHashSet(RoleEnum.STUDENT.name()).toString().hashCode()), s.name());
                     TBSession tbSessionPhone = (TBSession) redisUtil.getUserSession(sessionId);
                     if (Objects.nonNull(tbSessionPhone) && tbSessionPhone.getExpireTime() > System.currentTimeMillis()

+ 7 - 7
themis-exam/src/main/java/com/qmth/themis/exam/api/TEStudentController.java

@@ -100,12 +100,12 @@ public class TEStudentController {
 
     @ApiOperation(value = "学生登录接口")
     @RequestMapping(value = "/login", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "学生信息", response = TEExamResultDto.class)})
+    @ApiResponses({ @ApiResponse(code = 200, message = "学生信息", response = TEExamResultDto.class) })
     public Result login(
-            @ApiJsonObject(name = "loginStudent", value = {@ApiJsonProperty(key = "identity", description = "证件号"),
+            @ApiJsonObject(name = "loginStudent", value = { @ApiJsonProperty(key = "identity", description = "证件号"),
                     @ApiJsonProperty(key = "password", description = "密码"),
                     @ApiJsonProperty(key = "orgId", type = "long", example = "1", description = "机构id"),
-                    @ApiJsonProperty(key = "examId", type = "long", example = "1", description = "批次id")}) @ApiParam(value = "学生信息", required = true) @RequestBody Map<String, Object> mapParameter)
+                    @ApiJsonProperty(key = "examId", type = "long", example = "1", description = "批次id") }) @ApiParam(value = "学生信息", required = true) @RequestBody Map<String, Object> mapParameter)
             throws NoSuchAlgorithmException {
         if (Objects.isNull(mapParameter)) {
             throw new BusinessException(ExceptionResultEnum.STUDENT_IS_NULL);
@@ -212,7 +212,7 @@ public class TEStudentController {
         }
         //添加用户会话缓存
         String sessionId = SessionUtil
-                .digest(teStudent.getIdentity(), Math.abs(authDto.getRoleCodes().toString().hashCode()), source);
+                .digest(teStudent.getId(), Math.abs(authDto.getRoleCodes().toString().hashCode()), source);
 
         ExpireTimeDTO expireTime = SystemConstant.getExpireTime(source, platform);
         TBSession tbSession = new TBSession(sessionId, String.valueOf(teStudent.getId()),
@@ -285,7 +285,7 @@ public class TEStudentController {
 
     @ApiOperation(value = "登出接口")
     @RequestMapping(value = "/logout", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
+    @ApiResponses({ @ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class) })
     public Result logout() throws NoSuchAlgorithmException {
         TEStudentCacheDto teStudent = (TEStudentCacheDto) ServletUtil.getRequestStudentAccount();
         TBSession tbSession = (TBSession) ServletUtil.getRequestSession();
@@ -298,7 +298,7 @@ public class TEStudentController {
         boolean delete = true;
         for (Source s : Source.values()) {
             String sessionId = SessionUtil
-                    .digest(teStudent.getIdentity(), Math.abs(authDto.getRoleCodes().toString().hashCode()), s.name());
+                    .digest(teStudent.getId(), Math.abs(authDto.getRoleCodes().toString().hashCode()), s.name());
             if (Objects.nonNull(redisUtil.getUserSession(sessionId))) {
                 delete = false;
                 break;
@@ -328,7 +328,7 @@ public class TEStudentController {
      * @return
      */
     private ExamUnFinishBean unFinishCommon(Long recordId, ExamCacheBean ec, ExamStudentCacheBean examStudentCacheBean,
-                                            ExamActivityCacheBean examActivityCacheBean, Long examStudentId) {
+            ExamActivityCacheBean examActivityCacheBean, Long examStudentId) {
         ExamCourseCacheBean examCourseCacheBean = teExamCourseService
                 .getExamCourseCacheBean(ec.getId(), examStudentCacheBean.getCourseCode());
         TEExamActivityDto teExamActivityDto = new TEExamActivityDto(ec, examActivityCacheBean, examStudentCacheBean,