Browse Source

完善传参兼容性

DESKTOP-6LTVLN7\Liumouren 1 week ago
parent
commit
2285995192

+ 5 - 3
src/main/java/com/skyversation/poiaddr/controller/CorporateLibraryController.java

@@ -212,9 +212,11 @@ public class CorporateLibraryController {
         int sl = 3;
         String searchLevel = request.getParameter("searchLevel");
         try {
-            sl = Integer.parseInt(searchLevel);
-            if (sl < 1 || sl > 3) {
-                return MessageManage.getInstance().getResultContent(Constant.PARAM_ERROR, "参数错误", "参数错误");
+            if(StringUtils.hasText(searchLevel)){
+                sl = Integer.parseInt(searchLevel);
+                if (sl < 1 || sl > 3) {
+                    return MessageManage.getInstance().getResultContent(Constant.PARAM_ERROR, "参数错误", "参数错误");
+                }
             }
         } catch (Exception e) {
             return MessageManage.getInstance().getResultContent(Constant.PARAM_ERROR, "参数错误", "参数错误");