Browse Source

commit...

deason 1 year ago
parent
commit
5fefaefe64

+ 5 - 3
install/mysql/init/exam_reserve_db.sql

@@ -63,7 +63,8 @@ create table t_student
     PRIMARY KEY (id),
     UNIQUE KEY IDX_01 (apply_task_id, student_code),
     UNIQUE KEY IDX_02 (open_id, uid),
-    KEY IDX_03 (category_id)
+    KEY IDX_03 (category_id),
+    KEY IDX_04 (identity_number)
 ) comment '考生表';
 
 
@@ -169,8 +170,9 @@ create table t_student_apply
     operate_id     bigint comment '操作人ID',
     PRIMARY KEY (id),
     UNIQUE KEY IDX_01 (exam_site_id, time_period_id, student_id),
-    KEY IDX_02 (exam_room_id),
-    KEY IDX_03 (ticket_number)
+    KEY IDX_02 (student_id),
+    KEY IDX_03 (exam_room_id),
+    KEY IDX_04 (ticket_number)
 ) comment '考生预约记录表';
 
 

+ 12 - 2
src/main/java/com/qmth/exam/reserve/controller/BaseController.java

@@ -21,13 +21,23 @@ public class BaseController {
         if (user == null) {
             throw new StatusException("请先登录!");
         }
+
+        if (Role.STUDENT == user.getRole()) {
+            // 限制学生账号
+            throw new StatusException("当前用户禁止访问!");
+        }
         return user;
     }
 
     protected LoginUser curLoginStudent() {
-        LoginUser user = this.curLoginUser();
+        LoginUser user = (LoginUser) this.curRequest().getAttribute(ApiConstant.ATTRIBUTE_ACCESS_ENTITY);
+        if (user == null) {
+            throw new StatusException("请先登录!");
+        }
+
         if (Role.STUDENT != user.getRole()) {
-            throw new StatusException("请使用学生账号登录!");
+            // 限制非学生账号
+            throw new StatusException("当前用户禁止访问!");
         }
         return user;
     }

+ 4 - 4
src/main/java/com/qmth/exam/reserve/controller/admin/SystemPropertyController.java → src/main/java/com/qmth/exam/reserve/controller/student/SystemPropertyController.java

@@ -1,4 +1,4 @@
-package com.qmth.exam.reserve.controller.admin;
+package com.qmth.exam.reserve.controller.student;
 
 import com.qmth.boot.api.annotation.Aac;
 import com.qmth.boot.api.constant.ApiConstant;
@@ -23,9 +23,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
-@RestController
-@Api(tags = "系统常用属性相关接口")
-@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/system")
+@RestController("sysPropertyController")
+@Api(tags = "【考生端】系统常用属性相关接口")
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/student/system")
 @Aac(strict = false, auth = false)
 public class SystemPropertyController extends BaseController {
 

+ 2 - 3
src/main/resources/application.properties

@@ -9,7 +9,7 @@ spring.servlet.multipart.max-file-size=100MB
 spring.main.allow-bean-definition-overriding=true
 spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
 spring.jackson.time-zone=GMT+8
-server.tomcat.threads.max=600
+server.tomcat.threads.max=800
 server.tomcat.max-connections=20000
 server.tomcat.connection-timeout=90000
 #
@@ -39,7 +39,7 @@ com.qmth.fss.server=http://192.168.10.41:8300/file
 # ********** sys config **********
 #
 com.qmth.mybatis.block-attack=false
-com.qmth.mybatis.log-level=debug
+com.qmth.mybatis.log-level=info
 com.qmth.logging.root-level=info
 com.qmth.logging.file-path=logs/exam-reserve.log
 #
@@ -47,7 +47,6 @@ com.qmth.logging.file-path=logs/exam-reserve.log
 #
 com.qmth.auth.time-max-delay=10m
 com.qmth.auth.time-max-ahead=10m
-
 #
 # ********** wx config **********
 #