Browse Source

update ipLimit.

deason 1 year ago
parent
commit
5bb0adfd5e

+ 4 - 2
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/ExamController.java

@@ -1407,9 +1407,11 @@ public class ExamController extends ControllerSupport {
                                                  @RequestParam CommonsMultipartFile file) {
         DiskFileItem item = (DiskFileItem) file.getFileItem();
         File storeLocation = item.getStoreLocation();
+
+        int columnCount = 3;
         List<String[]> lineList;
         try {
-            lineList = ExcelReader.readSheetBySax(PathUtil.getCanonicalPath(storeLocation), 1, 2);
+            lineList = ExcelReader.readSheetBySax(PathUtil.getCanonicalPath(storeLocation), 1, columnCount);
         } catch (Exception e) {
             throw new StatusException("100110", "Excel 解析失败");
         }
@@ -1464,7 +1466,7 @@ public class ExamController extends ControllerSupport {
             entity.setLimitType(ipLimitType);
 
             // 备注
-            if(line.length == 3 && line[2] != null){
+            if(line.length == columnCount && line[2] != null){
                 entity.setRemark(line[2]);
             }