From 1596ce91095ad30f781006a2cfa5d856d3ac9416 Mon Sep 17 00:00:00 2001
From: zyx <zyx123456>
Date: 星期六, 09 九月 2023 11:00:45 +0800
Subject: [PATCH] Merge branch 'tzskasrs' of http://47.97.1.152:5880/r/zy-asrs into tzskasrs
---
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