From ccc693f973698fc6b0d333ccab8068114c53921b Mon Sep 17 00:00:00 2001
From: mrzhssss <pro6@qq.com>
Date: 星期五, 28 十月 2022 16:44:36 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/common/web/BaseController.java | 11 ++++++-----
1 files changed, 6 insertions(+), 5 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..b4678bf 100644
--- a/src/main/java/com/zy/common/web/BaseController.java
+++ b/src/main/java/com/zy/common/web/BaseController.java
@@ -1,6 +1,5 @@
package com.zy.common.web;
-import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
@@ -144,14 +143,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