From 21d0e7ab9d5c7316225a3e9eecf465cd37c9bd85 Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期四, 05 六月 2025 14:15:07 +0800
Subject: [PATCH] 123

---
 src/main/java/com/zy/common/web/BaseController.java |   19 +++++++++++++++----
 1 files changed, 15 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 01ce52c..8f1fade 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;
@@ -148,12 +147,24 @@
         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;
             }
         }
     }
+
+    public static boolean isNumber(String str){
+        for (int i = str.length();--i>=0;){
+            if (!Character.isDigit(str.charAt(i))){
+                return false;
+            }
+        }
+        return true;
+    }
+
 }

--
Gitblit v1.9.1