From 344a6d6c8c0f27f883615eb01d99ecc019aa7b25 Mon Sep 17 00:00:00 2001 From: zyx <zyx123456> Date: 星期一, 17 七月 2023 09:28:55 +0800 Subject: [PATCH] 完善AGV相关接口功能 --- src/main/java/com/zy/common/web/BaseController.java | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/zy/common/web/BaseController.java b/src/main/java/com/zy/common/web/BaseController.java index ca2925d..a61e965 100644 --- a/src/main/java/com/zy/common/web/BaseController.java +++ b/src/main/java/com/zy/common/web/BaseController.java @@ -144,14 +144,16 @@ } } - protected static boolean isJSON(String str) { + public static boolean isJSON(String str) { if (Cools.isEmpty(str)) { return false; } else { - try { - JSON.parse(str); + str = str.trim(); + if (str.startsWith("{") && str.endsWith("}")) { return true; - } catch (Exception e) { + } else if (str.startsWith("[") && str.endsWith("]")) { + return true; + } else { return false; } } -- Gitblit v1.9.1