From 8b1b075dcf044e6153dea0a4fc77233fda6e34e7 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期五, 11 十一月 2022 16:42:55 +0800 Subject: [PATCH] # --- src/main/java/com/zy/common/web/BaseController.java | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/zy/common/web/BaseController.java b/src/main/java/com/zy/common/web/BaseController.java index 60d9fc1..01ce52c 100644 --- a/src/main/java/com/zy/common/web/BaseController.java +++ b/src/main/java/com/zy/common/web/BaseController.java @@ -1,5 +1,6 @@ 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; @@ -142,4 +143,17 @@ wrapper.like(columns.get(i), condition); } } + + public static boolean isJSON(String str) { + if (Cools.isEmpty(str)) { + return false; + } else { + try { + JSON.parse(str); + return true; + } catch (Exception e) { + return false; + } + } + } } -- Gitblit v1.9.1