自动化立体仓库 - WMS系统
123
zhang
3 天以前 21d0e7ab9d5c7316225a3e9eecf465cd37c9bd85
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,16 +143,28 @@
        }
    }
    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;
            }
        }
    }
    public static boolean isNumber(String str){
        for (int i = str.length();--i>=0;){
            if (!Character.isDigit(str.charAt(i))){
                return false;
            }
        }
        return true;
    }
}