Forráskód Böngészése

后台基础库 数据码字段参数校验,同步码字段非必填

limingming 1 éve
szülő
commit
fcea34e39a

+ 11 - 7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/platform/BasicLibraryController.java

@@ -10,6 +10,7 @@ import com.ruoyi.common.core.domain.PageInfo;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.system.domain.BaseParam;
 import com.ruoyi.system.domain.BasicLibrary;
 import com.ruoyi.system.service.BasicLibraryService;
@@ -92,18 +93,21 @@ public class BasicLibraryController extends BaseController {
         if (param.getBootCodeSend() < 0){
             return R.fail("引导码发送次数参数有误");
         }
-        String[] synchronizeCode = param.getSynchronizeCode().split(",");
-        if (synchronizeCode.length != 2){
-            return R.fail("同步码参数格式有误");
-        }
-        if (param.getSynchronizeCodeSend() < 0){
-            return R.fail("同步码发送次数参数有误");
-        }
+//        String[] synchronizeCode = param.getSynchronizeCode().split(",");
+//        if (synchronizeCode.length != 2){
+//            return R.fail("同步码参数格式有误");
+//        }
+//        if (param.getSynchronizeCodeSend() < 0){
+//            return R.fail("同步码发送次数参数有误");
+//        }
 
 //        String[] dateCode = param.getDateCode().split(",");
 //        if (dateCode.length % 2 != 0){
 //            return R.fail("数据码参数有误");
 //        }
+        if (StringUtils.isEmpty(param.getDateCode())){
+            return R.fail("数据码参数不能为空");
+        }
 
         String[] dateBinary0 = param.getDateBinary0().split(",");
         if (dateBinary0.length != 2){