Browse Source

增加获取考试列表api接口的合法验证

ting.yin 6 years ago
parent
commit
6d6c149bf2

+ 5 - 5
stmms-web/src/main/java/cn/com/qmth/stmms/api/controller/ExamInfoController.java

@@ -59,10 +59,10 @@ public class ExamInfoController extends BaseApiController {
         if (query.getSchoolId() == null && user.getSchoolId() != null) {
         if (query.getSchoolId() == null && user.getSchoolId() != null) {
             query.setSchoolId(user.getSchoolId());
             query.setSchoolId(user.getSchoolId());
         }
         }
-            // query.setCreatorId(user.getId());
-            // query.addStatus(ExamStatus.START);
-            // query.setPageNumber(1);
-            // query.setPageSize(20);
+        if(user.getSchools().contains(query.getSchoolId())){
+        	// query.setCreatorId(user.getId());
+        	// query.addStatus(ExamStatus.START);
+        	// query.setPageNumber(1);
             if (query.getPageSize() < 20) {
             if (query.getPageSize() < 20) {
                 query.setPageSize(20);
                 query.setPageSize(20);
             }
             }
@@ -71,7 +71,7 @@ public class ExamInfoController extends BaseApiController {
             if (query.getCurrentCount() > 0) {
             if (query.getCurrentCount() > 0) {
                 list = query.getResult();
                 list = query.getResult();
             }
             }
-
+    	}
         for (Exam exam : list) {
         for (Exam exam : list) {
             JSONObject obj = new JSONObject();
             JSONObject obj = new JSONObject();
             obj.accumulate("id", exam.getId());
             obj.accumulate("id", exam.getId());