diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBoot401Exception.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBoot401Exception.java new file mode 100644 index 0000000..d8ffb34 --- /dev/null +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBoot401Exception.java @@ -0,0 +1,22 @@ +package org.jeecg.common.exception; + +/** + * 自定义401异常 + */ +public class JeecgBoot401Exception extends RuntimeException { + private static final long serialVersionUID = 1L; + + public JeecgBoot401Exception(String message){ + super(message); + } + + public JeecgBoot401Exception(Throwable cause) + { + super(cause); + } + + public JeecgBoot401Exception(String message, Throwable cause) + { + super(message,cause); + } +} diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBootAssertException.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBootAssertException.java new file mode 100644 index 0000000..58e7f9d --- /dev/null +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBootAssertException.java @@ -0,0 +1,18 @@ +package org.jeecg.common.exception; + +/** + * 断言异常 + */ +public class JeecgBootAssertException extends JeecgBootException { + private static final long serialVersionUID = 1L; + + + public JeecgBootAssertException(String message) { + super(message); + } + + public JeecgBootAssertException(String message, int errCode) { + super(message, errCode); + } + +} diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STASBizTipException.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBootBizTipException.java similarity index 62% rename from jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STASBizTipException.java rename to jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBootBizTipException.java index 533d661..3fff90d 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STASBizTipException.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBootBizTipException.java @@ -5,7 +5,7 @@ import org.jeecg.common.constant.CommonConstant; /** * 业务提醒异常(用于操作业务提醒) */ -public class STASBizTipException extends RuntimeException { +public class JeecgBootBizTipException extends RuntimeException { private static final long serialVersionUID = 1L; /** @@ -13,11 +13,11 @@ public class STASBizTipException extends RuntimeException { */ private int errCode = CommonConstant.SC_INTERNAL_SERVER_ERROR_500; - public STASBizTipException(String message){ + public JeecgBootBizTipException(String message){ super(message); } - public STASBizTipException(String message, int errCode){ + public JeecgBootBizTipException(String message, int errCode){ super(message); this.errCode = errCode; } @@ -26,12 +26,12 @@ public class STASBizTipException extends RuntimeException { return errCode; } - public STASBizTipException(Throwable cause) + public JeecgBootBizTipException(Throwable cause) { super(cause); } - public STASBizTipException(String message, Throwable cause) + public JeecgBootBizTipException(String message, Throwable cause) { super(message,cause); } diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STASException.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBootException.java similarity index 63% rename from jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STASException.java rename to jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBootException.java index 6f17e34..d4d28e1 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STASException.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBootException.java @@ -5,7 +5,7 @@ import org.jeecg.common.constant.CommonConstant; /** * 自定义异常 */ -public class STASException extends RuntimeException { +public class JeecgBootException extends RuntimeException { private static final long serialVersionUID = 1L; /** @@ -13,11 +13,11 @@ public class STASException extends RuntimeException { */ private int errCode = CommonConstant.SC_INTERNAL_SERVER_ERROR_500; - public STASException(String message){ + public JeecgBootException(String message){ super(message); } - public STASException(String message, int errCode){ + public JeecgBootException(String message, int errCode){ super(message); this.errCode = errCode; } @@ -26,12 +26,12 @@ public class STASException extends RuntimeException { return errCode; } - public STASException(Throwable cause) + public JeecgBootException(Throwable cause) { super(cause); } - public STASException(String message, Throwable cause) + public JeecgBootException(String message, Throwable cause) { super(message,cause); } diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STASExceptionHandler.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBootExceptionHandler.java similarity index 93% rename from jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STASExceptionHandler.java rename to jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBootExceptionHandler.java index 350dbe0..da42ba7 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STASExceptionHandler.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBootExceptionHandler.java @@ -42,7 +42,7 @@ import java.util.stream.Collectors; */ @RestControllerAdvice @Slf4j -public class STASExceptionHandler { +public class JeecgBootExceptionHandler { @Resource BaseCommonService baseCommonService; @@ -51,9 +51,9 @@ public class STASExceptionHandler { * 验证码错误异常 */ - @ExceptionHandler(STASCaptchaException.class) + @ExceptionHandler(JeecgCaptchaException.class) @ResponseStatus(HttpStatus.OK) - public Result handleJeecgCaptchaException(STASCaptchaException e) { + public Result handleJeecgCaptchaException(JeecgCaptchaException e) { log.error(e.getMessage(), e); return Result.error(e.getCode(), e.getMessage()); } @@ -75,8 +75,8 @@ public class STASExceptionHandler { /** * 处理自定义异常 */ - @ExceptionHandler(STASException.class) - public Result handleJeecgBootException(STASException e){ + @ExceptionHandler(JeecgBootException.class) + public Result handleJeecgBootException(JeecgBootException e){ log.error(e.getMessage(), e); addSysLog(e); return Result.error(e.getErrCode(), e.getMessage()); @@ -85,8 +85,8 @@ public class STASExceptionHandler { /** * 处理自定义异常 */ - @ExceptionHandler(STASBizTipException.class) - public Result handleJeecgBootBizTipException(STASBizTipException e){ + @ExceptionHandler(JeecgBootBizTipException.class) + public Result handleJeecgBootBizTipException(JeecgBootBizTipException e){ log.error(e.getMessage()); return Result.error(e.getErrCode(), e.getMessage()); } @@ -104,9 +104,9 @@ public class STASExceptionHandler { /** * 处理自定义异常 */ - @ExceptionHandler(STAS401Exception.class) + @ExceptionHandler(JeecgBoot401Exception.class) @ResponseStatus(HttpStatus.UNAUTHORIZED) - public Result handleJeecgBoot401Exception(STAS401Exception e){ + public Result handleJeecgBoot401Exception(JeecgBoot401Exception e){ log.error(e.getMessage(), e); addSysLog(e); return new Result(401,e.getMessage()); @@ -203,7 +203,7 @@ public class STASExceptionHandler { * @param exception * @return */ - @ExceptionHandler(STASSqlInjectionException.class) + @ExceptionHandler(JeecgSqlInjectionException.class) public Result handleSQLException(Exception exception) { String msg = exception.getMessage().toLowerCase(); final String extractvalue = "extractvalue"; diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STASCaptchaException.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgCaptchaException.java similarity index 54% rename from jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STASCaptchaException.java rename to jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgCaptchaException.java index 0ffb67d..8f34f71 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STASCaptchaException.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgCaptchaException.java @@ -3,22 +3,22 @@ package org.jeecg.common.exception; import lombok.Data; @Data -public class STASCaptchaException extends RuntimeException{ +public class JeecgCaptchaException extends RuntimeException{ private Integer code; private static final long serialVersionUID = -9093410345065209053L; - public STASCaptchaException(Integer code, String message) { + public JeecgCaptchaException(Integer code, String message) { super(message); this.code = code; } - public STASCaptchaException(String message, Throwable cause) { + public JeecgCaptchaException(String message, Throwable cause) { super(message, cause); } - public STASCaptchaException(Throwable cause) { + public JeecgCaptchaException(Throwable cause) { super(cause); } } diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STASFileUploadException.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgFileUploadException.java similarity index 61% rename from jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STASFileUploadException.java rename to jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgFileUploadException.java index ebeeec9..e0333c6 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STASFileUploadException.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgFileUploadException.java @@ -5,7 +5,7 @@ import org.jeecg.common.constant.CommonConstant; /** * 自定义文件上传异常 */ -public class STASFileUploadException extends RuntimeException { +public class JeecgFileUploadException extends RuntimeException { private static final long serialVersionUID = 1L; /** @@ -13,11 +13,11 @@ public class STASFileUploadException extends RuntimeException { */ private int errCode = CommonConstant.SC_INTERNAL_SERVER_ERROR_500; - public STASFileUploadException(String message){ + public JeecgFileUploadException(String message){ super(message); } - public STASFileUploadException(String message, int errCode){ + public JeecgFileUploadException(String message, int errCode){ super(message); this.errCode = errCode; } @@ -26,12 +26,12 @@ public class STASFileUploadException extends RuntimeException { return errCode; } - public STASFileUploadException(Throwable cause) + public JeecgFileUploadException(Throwable cause) { super(cause); } - public STASFileUploadException(String message, Throwable cause) + public JeecgFileUploadException(String message, Throwable cause) { super(message,cause); } diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgSqlInjectionException.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgSqlInjectionException.java new file mode 100644 index 0000000..1f6406b --- /dev/null +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgSqlInjectionException.java @@ -0,0 +1,22 @@ +package org.jeecg.common.exception; + +/** + * 自定义SQL注入异常 + */ +public class JeecgSqlInjectionException extends RuntimeException { + private static final long serialVersionUID = 1L; + + public JeecgSqlInjectionException(String message){ + super(message); + } + + public JeecgSqlInjectionException(Throwable cause) + { + super(cause); + } + + public JeecgSqlInjectionException(String message, Throwable cause) + { + super(message,cause); + } +} diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STAS401Exception.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STAS401Exception.java deleted file mode 100644 index daacf40..0000000 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STAS401Exception.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.jeecg.common.exception; - -/** - * 自定义401异常 - */ -public class STAS401Exception extends RuntimeException { - private static final long serialVersionUID = 1L; - - public STAS401Exception(String message){ - super(message); - } - - public STAS401Exception(Throwable cause) - { - super(cause); - } - - public STAS401Exception(String message, Throwable cause) - { - super(message,cause); - } -} diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STASAssertException.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STASAssertException.java deleted file mode 100644 index 038a0c1..0000000 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STASAssertException.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.jeecg.common.exception; - -/** - * 断言异常 - */ -public class STASAssertException extends STASException { - private static final long serialVersionUID = 1L; - - - public STASAssertException(String message) { - super(message); - } - - public STASAssertException(String message, int errCode) { - super(message, errCode); - } - -} diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STASSqlInjectionException.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STASSqlInjectionException.java deleted file mode 100644 index 8f7559c..0000000 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/STASSqlInjectionException.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.jeecg.common.exception; - -/** - * 自定义SQL注入异常 - */ -public class STASSqlInjectionException extends RuntimeException { - private static final long serialVersionUID = 1L; - - public STASSqlInjectionException(String message){ - super(message); - } - - public STASSqlInjectionException(Throwable cause) - { - super(cause); - } - - public STASSqlInjectionException(String message, Throwable cause) - { - super(message,cause); - } -} diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/query/QueryGenerator.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/query/QueryGenerator.java index 0773099..76b9d50 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/query/QueryGenerator.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/query/QueryGenerator.java @@ -14,7 +14,7 @@ import java.util.stream.Collectors; import org.apache.commons.beanutils.PropertyUtils; import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.DataBaseConstant; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.system.util.JeecgDataAutorUtils; import org.jeecg.common.system.util.JwtUtil; import org.jeecg.common.system.util.SqlConcatUtil; @@ -277,7 +277,7 @@ public class QueryGenerator { //判断column是不是当前实体的 log.debug("当前字段有:"+ allFields); if (!allColumnExist(column, allFields)) { - throw new STASException("请注意,将要排序的列字段不存在:" + column); + throw new JeecgBootException("请注意,将要排序的列字段不存在:" + column); } //update-end-author:taoyan date:2022-5-16 for: issues/3676 获取系统用户列表时,使用SQL注入生效 diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/util/JwtUtil.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/util/JwtUtil.java index 3645d19..a1a541c 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/util/JwtUtil.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/util/JwtUtil.java @@ -21,7 +21,7 @@ import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.DataBaseConstant; import org.jeecg.common.constant.SymbolConstant; import org.jeecg.common.constant.TenantConstant; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.system.vo.SysUserCacheInfo; import org.jeecg.common.util.DateUtils; @@ -138,13 +138,13 @@ public class JwtUtil { * * @param request * @return - * @throws STASException + * @throws JeecgBootException */ - public static String getUserNameByToken(HttpServletRequest request) throws STASException { + public static String getUserNameByToken(HttpServletRequest request) throws JeecgBootException { String accessToken = request.getHeader("X-Access-Token"); String username = getUsername(accessToken); if (oConvertUtils.isEmpty(username)) { - throw new STASException("未获取到用户"); + throw new JeecgBootException("未获取到用户"); } return username; } diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/AssertUtils.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/AssertUtils.java index 56717bf..ac502ea 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/AssertUtils.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/AssertUtils.java @@ -1,7 +1,7 @@ package org.jeecg.common.util; -import org.jeecg.common.exception.STASAssertException; +import org.jeecg.common.exception.JeecgBootAssertException; /** * 断言检查工具 @@ -16,13 +16,13 @@ public class AssertUtils { * * @param msg * @param obj - * @throws STASAssertException + * @throws JeecgBootAssertException * @author chenrui * @date 2017-06-22 10:05:56 */ public static void assertEmpty(String msg, Object obj) { if (oConvertUtils.isObjectNotEmpty(obj)) { - throw new STASAssertException(msg); + throw new JeecgBootAssertException(msg); } } @@ -32,13 +32,13 @@ public class AssertUtils { * * @param msg * @param obj - * @throws STASAssertException + * @throws JeecgBootAssertException * @author chenrui * @date 2017-06-22 10:05:56 */ public static void assertNotEmpty(String msg, Object obj) { if (oConvertUtils.isObjectEmpty(obj)) { - throw new STASAssertException(msg); + throw new JeecgBootAssertException(msg); } } @@ -57,7 +57,7 @@ public class AssertUtils { if (oConvertUtils.isEqual(expected, actual)) { return; } - throw new STASAssertException(message); + throw new JeecgBootAssertException(message); } /** @@ -72,7 +72,7 @@ public class AssertUtils { public static void assertNotEquals(String message, Object expected, Object actual) { if (oConvertUtils.isEqual(expected, actual)) { - throw new STASAssertException(message); + throw new JeecgBootAssertException(message); } } @@ -91,7 +91,7 @@ public class AssertUtils { if (expected == actual) { return; } - throw new STASAssertException(message); + throw new JeecgBootAssertException(message); } /** @@ -106,7 +106,7 @@ public class AssertUtils { public static void assertNotSame(String message, Object unexpected, Object actual) { if (unexpected == actual) { - throw new STASAssertException(message); + throw new JeecgBootAssertException(message); } } @@ -118,7 +118,7 @@ public class AssertUtils { */ public static void assertTrue(String message, boolean condition) { if (!condition) { - throw new STASAssertException(message); + throw new JeecgBootAssertException(message); } } @@ -140,7 +140,7 @@ public class AssertUtils { * @param obj * @param objs * @param - * @throws STASAssertException + * @throws JeecgBootAssertException * @author chenrui * @date 2018/1/31 22:14 */ @@ -148,7 +148,7 @@ public class AssertUtils { assertNotEmpty(message, obj); assertNotEmpty(message, objs); if (!oConvertUtils.isIn(obj, objs)) { - throw new STASAssertException(message); + throw new JeecgBootAssertException(message); } } @@ -159,7 +159,7 @@ public class AssertUtils { * @param obj * @param objs * @param - * @throws STASAssertException + * @throws JeecgBootAssertException * @author chenrui * @date 2018/1/31 22:14 */ @@ -168,7 +168,7 @@ public class AssertUtils { assertNotEmpty(message, obj); assertNotEmpty(message, objs); if (oConvertUtils.isIn(obj, objs)) { - throw new STASAssertException(message); + throw new JeecgBootAssertException(message); } } @@ -186,7 +186,7 @@ public class AssertUtils { if (oConvertUtils.isGt(src, des)) { return; } - throw new STASAssertException(message); + throw new JeecgBootAssertException(message); } /** @@ -202,7 +202,7 @@ public class AssertUtils { if (oConvertUtils.isGe(src, des)) { return; } - throw new STASAssertException(message); + throw new JeecgBootAssertException(message); } @@ -217,7 +217,7 @@ public class AssertUtils { */ public static void assertLt(String message, Number src, Number des) { if (oConvertUtils.isGe(src, des)) { - throw new STASAssertException(message); + throw new JeecgBootAssertException(message); } } @@ -232,7 +232,7 @@ public class AssertUtils { */ public static void assertLe(String message, Number src, Number des) { if (oConvertUtils.isGt(src, des)) { - throw new STASAssertException(message); + throw new JeecgBootAssertException(message); } } diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/CommonUtils.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/CommonUtils.java index ac769a8..b7e790f 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/CommonUtils.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/CommonUtils.java @@ -11,7 +11,7 @@ import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.DataBaseConstant; import org.jeecg.common.constant.ServiceNameConstants; import org.jeecg.common.constant.SymbolConstant; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.util.filter.SsrfFileTypeFilter; import org.jeecg.common.util.oss.OssBootUtil; import org.jeecgframework.poi.util.PoiPublicUtil; @@ -140,7 +140,7 @@ public class CommonUtils { } } catch (Exception e) { log.error(e.getMessage(), e); - throw new STASException(e.getMessage()); + throw new JeecgBootException(e.getMessage()); } return url; } diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FileDownloadUtils.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FileDownloadUtils.java index ed9db2f..acdfeb4 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FileDownloadUtils.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FileDownloadUtils.java @@ -3,7 +3,7 @@ package org.jeecg.common.util; import jakarta.servlet.http.HttpServletResponse; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.FilenameUtils; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import java.io.*; import java.net.URL; @@ -110,7 +110,7 @@ public class FileDownloadUtils { } } catch (IOException e) { log.error(e.getMessage(), e); - throw new STASException(e); + throw new JeecgBootException(e); } } @@ -142,11 +142,11 @@ public class FileDownloadUtils { return storePath; } catch (IOException e) { log.error(e.getMessage(), e); - throw new STASException(e); + throw new JeecgBootException(e); } } catch (IOException e) { log.error(e.getMessage(), e); - throw new STASException(e); + throw new JeecgBootException(e); } } diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SqlInjectionUtil.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SqlInjectionUtil.java index 46baa32..c11c62e 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SqlInjectionUtil.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SqlInjectionUtil.java @@ -4,7 +4,7 @@ import cn.hutool.core.util.ReUtil; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.SymbolConstant; -import org.jeecg.common.exception.STASSqlInjectionException; +import org.jeecg.common.exception.JeecgSqlInjectionException; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; @@ -103,7 +103,7 @@ public class SqlInjectionUtil { if (value.indexOf(xssArr[i]) > -1) { log.error(SqlInjectionUtil.SQL_INJECTION_KEYWORD_TIP, xssArr[i]); log.error(SqlInjectionUtil.SQL_INJECTION_TIP_VARIABLE, value); - throw new STASSqlInjectionException(SqlInjectionUtil.SQL_INJECTION_TIP + value); + throw new JeecgSqlInjectionException(SqlInjectionUtil.SQL_INJECTION_TIP + value); } } // 三、SQL注入检测存在绕过风险 (自定义传入普通文本校验) @@ -113,7 +113,7 @@ public class SqlInjectionUtil { if (value.indexOf(xssArr2[i]) > -1) { log.error(SqlInjectionUtil.SQL_INJECTION_KEYWORD_TIP, xssArr2[i]); log.error(SqlInjectionUtil.SQL_INJECTION_TIP_VARIABLE, value); - throw new STASSqlInjectionException(SqlInjectionUtil.SQL_INJECTION_TIP + value); + throw new JeecgSqlInjectionException(SqlInjectionUtil.SQL_INJECTION_TIP + value); } } } @@ -124,7 +124,7 @@ public class SqlInjectionUtil { if (Pattern.matches(regular, value)) { log.error(SqlInjectionUtil.SQL_INJECTION_KEYWORD_TIP, regularOriginal); log.error(SqlInjectionUtil.SQL_INJECTION_TIP_VARIABLE, value); - throw new STASSqlInjectionException(SqlInjectionUtil.SQL_INJECTION_TIP + value); + throw new JeecgSqlInjectionException(SqlInjectionUtil.SQL_INJECTION_TIP + value); } } return; @@ -205,7 +205,7 @@ public class SqlInjectionUtil { if (isExistSqlInjectKeyword(value, xssArr[i])) { log.error(SqlInjectionUtil.SQL_INJECTION_KEYWORD_TIP, xssArr[i]); log.error(SqlInjectionUtil.SQL_INJECTION_TIP_VARIABLE, value); - throw new STASSqlInjectionException(SqlInjectionUtil.SQL_INJECTION_TIP + value); + throw new JeecgSqlInjectionException(SqlInjectionUtil.SQL_INJECTION_TIP + value); } } @@ -215,7 +215,7 @@ public class SqlInjectionUtil { if (Pattern.matches(regular, value)) { log.error(SqlInjectionUtil.SQL_INJECTION_KEYWORD_TIP, regularOriginal); log.error(SqlInjectionUtil.SQL_INJECTION_TIP_VARIABLE, value); - throw new STASSqlInjectionException(SqlInjectionUtil.SQL_INJECTION_TIP + value); + throw new JeecgSqlInjectionException(SqlInjectionUtil.SQL_INJECTION_TIP + value); } } return; @@ -241,7 +241,7 @@ public class SqlInjectionUtil { if (isExistSqlInjectKeyword(value, xssArr[i])) { log.error(SqlInjectionUtil.SQL_INJECTION_KEYWORD_TIP, xssArr[i]); log.error(SqlInjectionUtil.SQL_INJECTION_TIP_VARIABLE, value); - throw new STASSqlInjectionException(SqlInjectionUtil.SQL_INJECTION_TIP + value); + throw new JeecgSqlInjectionException(SqlInjectionUtil.SQL_INJECTION_TIP + value); } } @@ -251,7 +251,7 @@ public class SqlInjectionUtil { if (Pattern.matches(regular, value)) { log.error(SqlInjectionUtil.SQL_INJECTION_KEYWORD_TIP, regularOriginal); log.error(SqlInjectionUtil.SQL_INJECTION_TIP_VARIABLE, value); - throw new STASSqlInjectionException(SqlInjectionUtil.SQL_INJECTION_TIP + value); + throw new JeecgSqlInjectionException(SqlInjectionUtil.SQL_INJECTION_TIP + value); } } return; @@ -274,7 +274,7 @@ public class SqlInjectionUtil { if(matcher.find()){ String error = "请注意,值可能存在SQL注入风险---> \\*.*\\"; log.error(error); - throw new STASSqlInjectionException(error); + throw new JeecgSqlInjectionException(error); } } @@ -312,7 +312,7 @@ public class SqlInjectionUtil { if (!isValidTableName) { String errorMsg = "表名不合法,存在SQL注入风险!--->" + table; log.error(errorMsg); - throw new STASSqlInjectionException(errorMsg); + throw new JeecgSqlInjectionException(errorMsg); } //进一步验证是否存在SQL注入风险 @@ -349,7 +349,7 @@ public class SqlInjectionUtil { if (!isValidField) { String errorMsg = "字段不合法,存在SQL注入风险!--->" + field; log.error(errorMsg); - throw new STASSqlInjectionException(errorMsg); + throw new JeecgSqlInjectionException(errorMsg); } //进一步验证是否存在SQL注入风险 diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/TokenUtils.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/TokenUtils.java index 0a3ee6e..95ddab7 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/TokenUtils.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/TokenUtils.java @@ -8,7 +8,7 @@ import org.jeecg.common.constant.CacheConstant; import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.TenantConstant; import org.jeecg.common.desensitization.util.SensitiveInfoUtil; -import org.jeecg.common.exception.STAS401Exception; +import org.jeecg.common.exception.JeecgBoot401Exception; import org.jeecg.common.system.util.JwtUtil; import org.jeecg.common.system.vo.LoginUser; @@ -95,28 +95,28 @@ public class TokenUtils { */ public static boolean verifyToken(String token, CommonAPI commonApi, RedisUtil redisUtil) { if (StringUtils.isBlank(token)) { - throw new STAS401Exception("token不能为空!"); + throw new JeecgBoot401Exception("token不能为空!"); } // 解密获得username,用于和数据库进行对比 String username = JwtUtil.getUsername(token); if (username == null) { - throw new STAS401Exception("token非法无效!"); + throw new JeecgBoot401Exception("token非法无效!"); } // 查询用户信息 //LoginUser user = TokenUtils.getLoginUser(username, commonApi, redisUtil); LoginUser user = commonApi.getUserByName(username); if (user == null) { - throw new STAS401Exception("用户不存在!"); + throw new JeecgBoot401Exception("用户不存在!"); } // 判断用户状态 if (user.getStatus() != 1) { - throw new STAS401Exception("账号已被锁定,请联系管理员!"); + throw new JeecgBoot401Exception("账号已被锁定,请联系管理员!"); } // 校验token是否超时失效 & 或者账号密码是否错误 if (!jwtTokenRefresh(token, username, user.getPassword(), redisUtil)) { - throw new STAS401Exception(CommonConstant.TOKEN_IS_INVALID_MSG); + throw new JeecgBoot401Exception(CommonConstant.TOKEN_IS_INVALID_MSG); } return true; } diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/dynamic/db/DynamicDBUtil.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/dynamic/db/DynamicDBUtil.java index 71f52f3..95bb042 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/dynamic/db/DynamicDBUtil.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/dynamic/db/DynamicDBUtil.java @@ -3,7 +3,7 @@ package org.jeecg.common.util.dynamic.db; import com.alibaba.druid.pool.DruidDataSource; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.ArrayUtils; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.system.vo.DynamicDataSourceModel; import org.jeecg.common.util.ReflectHelper; import org.jeecg.common.util.oConvertUtils; @@ -38,7 +38,7 @@ public class DynamicDBUtil { String url = dbSource.getDbUrl(); // url配置成 “123” 会触发Druid死循环,一直去重复尝试连接 if (oConvertUtils.isEmpty(url) || !url.toLowerCase().startsWith("jdbc:")) { - throw new STASException("数据源URL配置格式不正确!"); + throw new JeecgBootException("数据源URL配置格式不正确!"); } String dbUser = dbSource.getDbUsername(); @@ -88,7 +88,7 @@ public class DynamicDBUtil { DataSourceCachePool.putCacheBasicDataSource(dbKey, dataSource); }else{ - throw new STASException("动态数据源连接失败,dbKey:"+dbKey); + throw new JeecgBootException("动态数据源连接失败,dbKey:"+dbKey); } log.info("--------getDbSourceBydbKey------------------创建DB数据库连接-------------------"); return dataSource; diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/security/AbstractQueryBlackListHandler.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/security/AbstractQueryBlackListHandler.java index 27b57ca..8b7e5e2 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/security/AbstractQueryBlackListHandler.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/security/AbstractQueryBlackListHandler.java @@ -2,7 +2,7 @@ package org.jeecg.common.util.security; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; -import org.jeecg.common.exception.STASSqlInjectionException; +import org.jeecg.common.exception.JeecgSqlInjectionException; import java.util.*; import java.util.regex.Matcher; @@ -86,7 +86,7 @@ public abstract class AbstractQueryBlackListHandler { // 返回黑名单校验结果(不合法直接抛出异常) if(!flag){ log.error(this.getError()); - throw new STASSqlInjectionException(this.getError()); + throw new JeecgSqlInjectionException(this.getError()); } return flag; } diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/security/JdbcSecurityUtil.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/security/JdbcSecurityUtil.java index b651bca..ab948f7 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/security/JdbcSecurityUtil.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/security/JdbcSecurityUtil.java @@ -1,6 +1,6 @@ package org.jeecg.common.util.security; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.util.oConvertUtils; /** @@ -37,7 +37,7 @@ public class JdbcSecurityUtil { String key = temp.split("=")[0]; for(String prop: notAllowedProps){ if(prop.equalsIgnoreCase(key)){ - throw new STASException("连接地址有安全风险,【"+key+"】"); + throw new JeecgBootException("连接地址有安全风险,【"+key+"】"); } } } diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/app/AppGrantAuthenticationProvider.java b/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/app/AppGrantAuthenticationProvider.java index 93aa4e2..1503261 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/app/AppGrantAuthenticationProvider.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/app/AppGrantAuthenticationProvider.java @@ -5,7 +5,7 @@ import lombok.extern.slf4j.Slf4j; import org.jeecg.common.api.CommonAPI; import org.jeecg.common.constant.CacheConstant; import org.jeecg.common.constant.CommonConstant; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.system.vo.SysDepartModel; import org.jeecg.common.util.Md5Util; @@ -295,19 +295,19 @@ public class AppGrantAuthenticationProvider implements AuthenticationProvider { //情况1:根据用户信息查询,该用户不存在 if (Objects.isNull(loginUser)) { baseCommonService.addLog("用户登录失败,用户不存在!", CommonConstant.LOG_TYPE_1, null); - throw new STASException("该用户不存在,请注册"); + throw new JeecgBootException("该用户不存在,请注册"); } //情况2:根据用户信息查询,该用户已注销 //update-begin---author:王帅 Date:20200601 for:if条件永远为falsebug------------ if (CommonConstant.DEL_FLAG_1.equals(loginUser.getDelFlag())) { //update-end---author:王帅 Date:20200601 for:if条件永远为falsebug------------ baseCommonService.addLog("用户登录失败,用户名:" + loginUser.getUsername() + "已注销!", CommonConstant.LOG_TYPE_1, null); - throw new STASException("该用户已注销"); + throw new JeecgBootException("该用户已注销"); } //情况3:根据用户信息查询,该用户已冻结 if (CommonConstant.USER_FREEZE.equals(loginUser.getStatus())) { baseCommonService.addLog("用户登录失败,用户名:" + loginUser.getUsername() + "已冻结!", CommonConstant.LOG_TYPE_1, null); - throw new STASException("该用户已冻结"); + throw new JeecgBootException("该用户已冻结"); } } diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/password/PasswordGrantAuthenticationProvider.java b/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/password/PasswordGrantAuthenticationProvider.java index e0e4716..faba65e 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/password/PasswordGrantAuthenticationProvider.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/password/PasswordGrantAuthenticationProvider.java @@ -5,7 +5,7 @@ import lombok.extern.slf4j.Slf4j; import org.jeecg.common.api.CommonAPI; import org.jeecg.common.constant.CacheConstant; import org.jeecg.common.constant.CommonConstant; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.system.vo.SysDepartModel; import org.jeecg.common.util.Md5Util; @@ -94,11 +94,11 @@ public class PasswordGrantAuthenticationProvider implements AuthenticationProvid // 检查登录失败次数 if(isLoginFailOvertimes(username)){ - throw new STASException("该用户登录失败次数过多,请于10分钟后再次登录!"); + throw new JeecgBootException("该用户登录失败次数过多,请于10分钟后再次登录!"); } if(captcha==null){ - throw new STASException("验证码无效"); + throw new JeecgBootException("验证码无效"); } String lowerCaseCaptcha = captcha.toLowerCase(); // 加入密钥作为混淆,避免简单的拼接,被外部利用,用户自定义该密钥即可 @@ -292,19 +292,19 @@ public class PasswordGrantAuthenticationProvider implements AuthenticationProvid //情况1:根据用户信息查询,该用户不存在 if (Objects.isNull(loginUser)) { baseCommonService.addLog("用户登录失败,用户不存在!", CommonConstant.LOG_TYPE_1, null); - throw new STASException("该用户不存在,请注册"); + throw new JeecgBootException("该用户不存在,请注册"); } //情况2:根据用户信息查询,该用户已注销 //update-begin---author:王帅 Date:20200601 for:if条件永远为falsebug------------ if (CommonConstant.DEL_FLAG_1.equals(loginUser.getDelFlag())) { //update-end---author:王帅 Date:20200601 for:if条件永远为falsebug------------ baseCommonService.addLog("用户登录失败,用户名:" + loginUser.getUsername() + "已注销!", CommonConstant.LOG_TYPE_1, null); - throw new STASException("该用户已注销"); + throw new JeecgBootException("该用户已注销"); } //情况3:根据用户信息查询,该用户已冻结 if (CommonConstant.USER_FREEZE.equals(loginUser.getStatus())) { baseCommonService.addLog("用户登录失败,用户名:" + loginUser.getUsername() + "已冻结!", CommonConstant.LOG_TYPE_1, null); - throw new STASException("该用户已冻结"); + throw new JeecgBootException("该用户已冻结"); } } diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/phone/PhoneGrantAuthenticationProvider.java b/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/phone/PhoneGrantAuthenticationProvider.java index 3e012b4..2bbcf3b 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/phone/PhoneGrantAuthenticationProvider.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/phone/PhoneGrantAuthenticationProvider.java @@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONObject; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.api.CommonAPI; import org.jeecg.common.constant.CommonConstant; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.system.vo.SysDepartModel; import org.jeecg.common.util.RedisUtil; @@ -77,7 +77,7 @@ public class PhoneGrantAuthenticationProvider implements AuthenticationProvider String phone = (String) additionalParameter.get("mobile"); if(isLoginFailOvertimes(phone)){ - throw new STASException("该用户登录失败次数过多,请于10分钟后再次登录!"); + throw new JeecgBootException("该用户登录失败次数过多,请于10分钟后再次登录!"); } //请求参数权限范围 @@ -265,19 +265,19 @@ public class PhoneGrantAuthenticationProvider implements AuthenticationProvider //情况1:根据用户信息查询,该用户不存在 if (Objects.isNull(loginUser)) { baseCommonService.addLog("用户登录失败,用户不存在!", CommonConstant.LOG_TYPE_1, null); - throw new STASException("该用户不存在,请注册"); + throw new JeecgBootException("该用户不存在,请注册"); } //情况2:根据用户信息查询,该用户已注销 //update-begin---author:王帅 Date:20200601 for:if条件永远为falsebug------------ if (CommonConstant.DEL_FLAG_1.equals(loginUser.getDelFlag())) { //update-end---author:王帅 Date:20200601 for:if条件永远为falsebug------------ baseCommonService.addLog("用户登录失败,用户名:" + loginUser.getUsername() + "已注销!", CommonConstant.LOG_TYPE_1, null); - throw new STASException("该用户已注销"); + throw new JeecgBootException("该用户已注销"); } //情况3:根据用户信息查询,该用户已冻结 if (CommonConstant.USER_FREEZE.equals(loginUser.getStatus())) { baseCommonService.addLog("用户登录失败,用户名:" + loginUser.getUsername() + "已冻结!", CommonConstant.LOG_TYPE_1, null); - throw new STASException("该用户已冻结"); + throw new JeecgBootException("该用户已冻结"); } } diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/self/SelfAuthenticationProvider.java b/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/self/SelfAuthenticationProvider.java index 3ff783d..d1b1f46 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/self/SelfAuthenticationProvider.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/self/SelfAuthenticationProvider.java @@ -2,8 +2,8 @@ package org.jeecg.config.security.self; import org.jeecg.common.api.CommonAPI; import org.jeecg.common.constant.CommonConstant; -import org.jeecg.common.exception.STAS401Exception; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; +import org.jeecg.common.exception.JeecgBoot401Exception; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.util.RedisUtil; import org.jeecg.config.JeecgBaseConfig; @@ -106,7 +106,7 @@ public class SelfAuthenticationProvider implements AuthenticationProvider { OAuth2TokenContext tokenContext = tokenContextBuilder.tokenType(OAuth2TokenType.ACCESS_TOKEN).build(); OAuth2Token generatedAccessToken = this.tokenGenerator.generate(tokenContext); if (generatedAccessToken == null) { - throw new STAS401Exception("无法生成刷新token,请联系管理员。"); + throw new JeecgBoot401Exception("无法生成刷新token,请联系管理员。"); } OAuth2AccessToken accessToken = new OAuth2AccessToken(OAuth2AccessToken.TokenType.BEARER, generatedAccessToken.getTokenValue(), generatedAccessToken.getIssuedAt(), @@ -169,19 +169,19 @@ public class SelfAuthenticationProvider implements AuthenticationProvider { //情况1:根据用户信息查询,该用户不存在 if (Objects.isNull(loginUser)) { baseCommonService.addLog("用户登录失败,用户不存在!", CommonConstant.LOG_TYPE_1, null); - throw new STASException("该用户不存在,请注册"); + throw new JeecgBootException("该用户不存在,请注册"); } //情况2:根据用户信息查询,该用户已注销 //update-begin---author:王帅 Date:20200601 for:if条件永远为falsebug------------ if (CommonConstant.DEL_FLAG_1.equals(loginUser.getDelFlag())) { //update-end---author:王帅 Date:20200601 for:if条件永远为falsebug------------ baseCommonService.addLog("用户登录失败,用户名:" + loginUser.getUsername() + "已注销!", CommonConstant.LOG_TYPE_1, null); - throw new STASException("该用户已注销"); + throw new JeecgBootException("该用户已注销"); } //情况3:根据用户信息查询,该用户已冻结 if (CommonConstant.USER_FREEZE.equals(loginUser.getStatus())) { baseCommonService.addLog("用户登录失败,用户名:" + loginUser.getUsername() + "已冻结!", CommonConstant.LOG_TYPE_1, null); - throw new STASException("该用户已冻结"); + throw new JeecgBootException("该用户已冻结"); } } } diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/social/SocialGrantAuthenticationProvider.java b/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/social/SocialGrantAuthenticationProvider.java index 953aa7a..d9ba7a4 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/social/SocialGrantAuthenticationProvider.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/social/SocialGrantAuthenticationProvider.java @@ -6,7 +6,7 @@ import com.auth0.jwt.interfaces.DecodedJWT; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.api.CommonAPI; import org.jeecg.common.constant.CommonConstant; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.system.vo.SysDepartModel; import org.jeecg.common.util.RedisUtil; @@ -255,19 +255,19 @@ public class SocialGrantAuthenticationProvider implements AuthenticationProvider //情况1:根据用户信息查询,该用户不存在 if (Objects.isNull(loginUser)) { baseCommonService.addLog("用户登录失败,用户不存在!", CommonConstant.LOG_TYPE_1, null); - throw new STASException("该用户不存在,请注册"); + throw new JeecgBootException("该用户不存在,请注册"); } //情况2:根据用户信息查询,该用户已注销 //update-begin---author:王帅 Date:20200601 for:if条件永远为falsebug------------ if (CommonConstant.DEL_FLAG_1.equals(loginUser.getDelFlag())) { //update-end---author:王帅 Date:20200601 for:if条件永远为falsebug------------ baseCommonService.addLog("用户登录失败,用户名:" + loginUser.getUsername() + "已注销!", CommonConstant.LOG_TYPE_1, null); - throw new STASException("该用户已注销"); + throw new JeecgBootException("该用户已注销"); } //情况3:根据用户信息查询,该用户已冻结 if (CommonConstant.USER_FREEZE.equals(loginUser.getStatus())) { baseCommonService.addLog("用户登录失败,用户名:" + loginUser.getUsername() + "已冻结!", CommonConstant.LOG_TYPE_1, null); - throw new STASException("该用户已冻结"); + throw new JeecgBootException("该用户已冻结"); } } diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/config/sign/util/SignUtil.java b/jeecg-boot-base-core/src/main/java/org/jeecg/config/sign/util/SignUtil.java index 6be51c4..a85a466 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/config/sign/util/SignUtil.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/config/sign/util/SignUtil.java @@ -3,7 +3,7 @@ package org.jeecg.config.sign.util; import com.alibaba.fastjson.JSONObject; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.constant.SymbolConstant; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.util.SpringContextUtils; import org.jeecg.common.util.oConvertUtils; import org.jeecg.config.JeecgBaseConfig; @@ -53,7 +53,7 @@ public class SignUtil { String signatureSecret = jeecgBaseConfig.getSignatureSecret(); String curlyBracket = SymbolConstant.DOLLAR + SymbolConstant.LEFT_CURLY_BRACKET; if(oConvertUtils.isEmpty(signatureSecret) || signatureSecret.contains(curlyBracket)){ - throw new STASException("签名密钥 ${jeecg.signatureSecret} 缺少配置 !!"); + throw new JeecgBootException("签名密钥 ${jeecg.signatureSecret} 缺少配置 !!"); } try { //【issues/I484RW】2.4.6部署后,下拉搜索框提示“sign签名检验失败” diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/config/firewall/SqlInjection/impl/DictTableWhiteListHandlerImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/config/firewall/SqlInjection/impl/DictTableWhiteListHandlerImpl.java index 1185102..f4cf29c 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/config/firewall/SqlInjection/impl/DictTableWhiteListHandlerImpl.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/config/firewall/SqlInjection/impl/DictTableWhiteListHandlerImpl.java @@ -2,7 +2,7 @@ package org.jeecg.config.firewall.SqlInjection.impl; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.constant.SymbolConstant; -import org.jeecg.common.exception.STASSqlInjectionException; +import org.jeecg.common.exception.JeecgSqlInjectionException; import org.jeecg.common.util.oConvertUtils; import org.jeecg.config.JeecgBaseConfig; import org.jeecg.config.firewall.SqlInjection.IDictTableWhiteListHandler; @@ -259,16 +259,16 @@ public class DictTableWhiteListHandlerImpl implements IDictTableWhiteListHandler return tableName.replaceAll(reg, ""); } - private void throwException() throws STASSqlInjectionException { + private void throwException() throws JeecgSqlInjectionException { this.throwException(this.getErrorMsg()); } - private void throwException(String message) throws STASSqlInjectionException { + private void throwException(String message) throws JeecgSqlInjectionException { if (oConvertUtils.isEmpty(message)) { message = this.getErrorMsg(); } log.error(message); - throw new STASSqlInjectionException(message); + throw new JeecgSqlInjectionException(message); } @Override diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/message/handle/impl/SystemSendMsgHandle.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/message/handle/impl/SystemSendMsgHandle.java index e99d68b..087ed9b 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/message/handle/impl/SystemSendMsgHandle.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/message/handle/impl/SystemSendMsgHandle.java @@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONObject; import org.jeecg.common.api.dto.message.MessageDTO; import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.WebsocketConst; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.system.api.ISysBaseAPI; import org.jeecg.common.util.SpringContextUtils; import org.jeecg.common.util.oConvertUtils; @@ -54,7 +54,7 @@ public class SystemSendMsgHandle implements ISendMsgHandle { @Override public void sendMsg(String esReceiver, String esTitle, String esContent) { if(oConvertUtils.isEmpty(esReceiver)){ - throw new STASException("被发送人不能为空"); + throw new JeecgBootException("被发送人不能为空"); } ISysBaseAPI sysBaseApi = SpringContextUtils.getBean(ISysBaseAPI.class); MessageDTO messageDTO = new MessageDTO(FROM_USER,esReceiver,esTitle,esContent); diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/openapi/filter/ApiAuthFilter.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/openapi/filter/ApiAuthFilter.java index a97bab5..a301d13 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/openapi/filter/ApiAuthFilter.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/openapi/filter/ApiAuthFilter.java @@ -3,7 +3,7 @@ package org.jeecg.modules.openapi.filter; import jakarta.servlet.*; import jakarta.servlet.http.HttpServletRequest; import lombok.extern.slf4j.Slf4j; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.modules.openapi.entity.OpenApi; import org.jeecg.modules.openapi.entity.OpenApiAuth; import org.jeecg.modules.openapi.entity.OpenApiLog; @@ -92,7 +92,7 @@ public class ApiAuthFilter implements Filter { List blackList = Arrays.asList(openApi.getBlackList().split(",")); if (blackList.contains(ip)) { - throw new STASException("目标接口限制IP[" + ip + "]进行访问,IP已记录,请停止访问"); + throw new JeecgBootException("目标接口限制IP[" + ip + "]进行访问,IP已记录,请停止访问"); } } @@ -105,19 +105,19 @@ public class ApiAuthFilter implements Filter { */ protected void checkSignValid(String appkey, String signature, String timestamp) { if (!StringUtils.hasText(appkey)) { - throw new STASException("appkey为空"); + throw new JeecgBootException("appkey为空"); } if (!StringUtils.hasText(signature)) { - throw new STASException("signature为空"); + throw new JeecgBootException("signature为空"); } if (!StringUtils.hasText(timestamp)) { - throw new STASException("timastamp时间戳为空"); + throw new JeecgBootException("timastamp时间戳为空"); } if (!timestamp.matches("[0-9]*")) { - throw new STASException("timastamp时间戳不合法"); + throw new JeecgBootException("timastamp时间戳不合法"); } if (System.currentTimeMillis() - Long.parseLong(timestamp) > 5 * 60 * 1000) { - throw new STASException("signature签名已过期(超过五分钟)"); + throw new JeecgBootException("signature签名已过期(超过五分钟)"); } } @@ -132,15 +132,15 @@ public class ApiAuthFilter implements Filter { */ protected void checkSignature(String appKey, String signature, String timestamp, OpenApiAuth openApiAuth) { if(openApiAuth==null){ - throw new STASException("不存在认证信息"); + throw new JeecgBootException("不存在认证信息"); } if(!appKey.equals(openApiAuth.getAk())){ - throw new STASException("appkey错误"); + throw new JeecgBootException("appkey错误"); } if (!signature.equals(md5(appKey + openApiAuth.getSk() + timestamp))) { - throw new STASException("signature签名错误"); + throw new JeecgBootException("signature签名错误"); } } @@ -156,7 +156,7 @@ public class ApiAuthFilter implements Filter { } if (!hasPermission) { - throw new STASException("该appKey未授权当前接口"); + throw new JeecgBootException("该appKey未授权当前接口"); } } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/oss/service/impl/OssFileServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/oss/service/impl/OssFileServiceImpl.java index b1604cd..6c2be33 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/oss/service/impl/OssFileServiceImpl.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/oss/service/impl/OssFileServiceImpl.java @@ -1,7 +1,7 @@ package org.jeecg.modules.oss.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.util.CommonUtils; import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oss.OssBootUtil; @@ -26,7 +26,7 @@ public class OssFileServiceImpl extends ServiceImpl impl ossFile.setFileName(fileName); String url = OssBootUtil.upload(multipartFile,"upload/test"); if(oConvertUtils.isEmpty(url)){ - throw new STASException("上传文件失败! "); + throw new JeecgBootException("上传文件失败! "); } //update-begin--Author:scott Date:20201227 for:JT-361【文件预览】阿里云原生域名可以文件预览,自己映射域名kkfileview提示文件下载失败------------------- // 返回阿里云原生域名前缀URL diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/quartz/service/impl/QuartzJobServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/quartz/service/impl/QuartzJobServiceImpl.java index 3a2ae8a..67e8b52 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/quartz/service/impl/QuartzJobServiceImpl.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/quartz/service/impl/QuartzJobServiceImpl.java @@ -3,7 +3,7 @@ package org.jeecg.modules.quartz.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.constant.CommonConstant; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.util.DateUtils; import org.jeecg.modules.quartz.entity.QuartzJob; import org.jeecg.modules.quartz.mapper.QuartzJobMapper; @@ -44,7 +44,7 @@ public class QuartzJobServiceImpl extends ServiceImpl { * 根据父级编码加载分类字典的数据 * @param pcode * @return - * @throws STASException + * @throws JeecgBootException */ - public List queryListByCode(String pcode) throws STASException; + public List queryListByCode(String pcode) throws JeecgBootException; /** * 根据pid查询子节点集合 diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/ISysPermissionService.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/ISysPermissionService.java index 3d0d076..f476c6d 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/ISysPermissionService.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/ISysPermissionService.java @@ -2,7 +2,7 @@ package org.jeecg.modules.system.service; import java.util.List; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.modules.system.entity.SysPermission; import org.jeecg.modules.system.model.TreeModel; @@ -32,29 +32,29 @@ public interface ISysPermissionService extends IService { /** * 真实删除 * @param id 菜单id - * @throws STASException + * @throws JeecgBootException */ - public void deletePermission(String id) throws STASException; + public void deletePermission(String id) throws JeecgBootException; /** * 逻辑删除 * @param id 菜单id - * @throws STASException + * @throws JeecgBootException */ - public void deletePermissionLogical(String id) throws STASException; + public void deletePermissionLogical(String id) throws JeecgBootException; /** * 添加菜单 * @param sysPermission SysPermission对象 - * @throws STASException + * @throws JeecgBootException */ - public void addPermission(SysPermission sysPermission) throws STASException; + public void addPermission(SysPermission sysPermission) throws JeecgBootException; /** * 编辑菜单 * @param sysPermission SysPermission对象 - * @throws STASException + * @throws JeecgBootException */ - public void editPermission(SysPermission sysPermission) throws STASException; + public void editPermission(SysPermission sysPermission) throws JeecgBootException; /** * 获取登录用户拥有的权限 diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/AuthUserServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/AuthUserServiceImpl.java index c2e84fb..34c089e 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/AuthUserServiceImpl.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/AuthUserServiceImpl.java @@ -25,7 +25,7 @@ import org.jeecg.common.constant.SymbolConstant; import org.jeecg.common.constant.enums.DySmsEnum; import org.jeecg.common.constant.enums.RoleIndexConfigEnum; import org.jeecg.common.desensitization.annotation.SensitiveEncode; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.system.vo.SysUserCacheInfo; import org.jeecg.common.util.*; @@ -1524,7 +1524,7 @@ public class AuthUserServiceImpl extends ServiceImpl im Long adminRoleCount = this.authUserMapper.selectCount(query); //大于0说明存在管理员用户,不允许删除 if(adminRoleCount>0){ - throw new STASException("admin用户,不允许删除!"); + throw new JeecgBootException("admin用户,不允许删除!"); } } @@ -1534,15 +1534,15 @@ public class AuthUserServiceImpl extends ServiceImpl im String phone = json.getString("phone"); String type = json.getString("type"); if(oConvertUtils.isEmpty(phone)){ - throw new STASException("请填写原手机号!"); + throw new JeecgBootException("请填写原手机号!"); } if(oConvertUtils.isEmpty(smscode)){ - throw new STASException("请填写验证码!"); + throw new JeecgBootException("请填写验证码!"); } //step1 验证原手机号是否和当前用户匹配 SysUser sysUser = authUserMapper.getUserByNameAndPhone(phone,username); if (null == sysUser){ - throw new STASException("原手机号不匹配,无法修改密码!"); + throw new JeecgBootException("原手机号不匹配,无法修改密码!"); } //step2 根据类型判断是验证原手机号的验证码还是新手机号的验证码 //验证原手机号 @@ -1553,7 +1553,7 @@ public class AuthUserServiceImpl extends ServiceImpl im String newPhone = json.getString("newPhone"); //需要验证新手机号和原手机号是否一致,一致不让修改 if(newPhone.equals(phone)){ - throw new STASException("新手机号与原手机号一致,无法修改!"); + throw new JeecgBootException("新手机号与原手机号一致,无法修改!"); } this.verifyPhone(newPhone, smscode); //step3 新手机号验证码验证成功之后即可修改手机号 @@ -1573,10 +1573,10 @@ public class AuthUserServiceImpl extends ServiceImpl im String phoneKey = CommonConstant.CHANGE_PHONE_REDIS_KEY_PRE + phone; Object phoneCode = redisUtil.get(phoneKey); if(null == phoneCode){ - throw new STASException("验证码失效,请重新发送验证码!"); + throw new JeecgBootException("验证码失效,请重新发送验证码!"); } if(!smsCode.equals(phoneCode.toString())) { - throw new STASException("短信验证码不匹配!"); + throw new JeecgBootException("短信验证码不匹配!"); } //验证完成之后清空手机验证码 redisUtil.removeAll(phoneKey); @@ -1587,20 +1587,20 @@ public class AuthUserServiceImpl extends ServiceImpl im String type = jsonObject.getString("type"); String phone = jsonObject.getString("phone"); if(oConvertUtils.isEmpty(phone)){ - throw new STASException("请填写手机号!"); + throw new JeecgBootException("请填写手机号!"); } //step1 根据类型判断是发送旧手机号验证码还是新的手机号验证码 if(CommonConstant.VERIFY_ORIGINAL_PHONE.equals(type)){ //step2 旧手机号验证码需要验证手机号是否匹配 SysUser sysUser = authUserMapper.getUserByNameAndPhone(phone, username); if(null == sysUser){ - throw new STASException("旧手机号不匹配,无法修改手机号!"); + throw new JeecgBootException("旧手机号不匹配,无法修改手机号!"); } }else if(CommonConstant.UPDATE_PHONE.equals(type)){ //step3 新手机号需要验证手机号码是否已注册过 SysUser userByPhone = authUserMapper.getUserByPhone(phone); if(null != userByPhone){ - throw new STASException("手机号已被注册,请尝试其他手机号!"); + throw new JeecgBootException("手机号已被注册,请尝试其他手机号!"); } } //step4 发送短信验证码 @@ -1614,7 +1614,7 @@ public class AuthUserServiceImpl extends ServiceImpl im //通过用户名查询数据库中的手机号 SysUser userByNameAndPhone = authUserMapper.getUserByNameAndPhone(phone, username); if (null == userByNameAndPhone) { - throw new STASException("当前用户手机号不匹配,无法修改!"); + throw new JeecgBootException("当前用户手机号不匹配,无法修改!"); } String code = CommonConstant.LOG_OFF_PHONE_REDIS_KEY_PRE + phone; this.sendPhoneSms(phone, ipAddress, code); @@ -1628,15 +1628,15 @@ public class AuthUserServiceImpl extends ServiceImpl im //通过用户名查询数据库中的手机号 SysUser userByNameAndPhone = authUserMapper.getUserByNameAndPhone(phone, username); if (null == userByNameAndPhone) { - throw new STASException("当前用户手机号不匹配,无法注销!"); + throw new JeecgBootException("当前用户手机号不匹配,无法注销!"); } String code = CommonConstant.LOG_OFF_PHONE_REDIS_KEY_PRE + phone; Object redisSmdCode = redisUtil.get(code); if (null == redisSmdCode) { - throw new STASException("验证码失效,无法注销!"); + throw new JeecgBootException("验证码失效,无法注销!"); } if (!redisSmdCode.toString().equals(smsCode)) { - throw new STASException("验证码不匹配,无法注销!"); + throw new JeecgBootException("验证码不匹配,无法注销!"); } this.deleteUser(userByNameAndPhone.getId()); redisUtil.removeAll(code); @@ -1792,13 +1792,13 @@ public class AuthUserServiceImpl extends ServiceImpl im Object object = redisUtil.get(redisKey); if (object != null) { - throw new STASException("验证码10分钟内,仍然有效!"); + throw new JeecgBootException("验证码10分钟内,仍然有效!"); } //增加 check防止恶意刷短信接口 if(!DySmsLimit.canSendSms(clientIp)){ log.warn("--------[警告] IP地址:{}, 短信接口请求太多-------", clientIp); - throw new STASException("短信接口请求太多,请稍后再试!", CommonConstant.PHONE_SMS_FAIL_CODE); + throw new JeecgBootException("短信接口请求太多,请稍后再试!", CommonConstant.PHONE_SMS_FAIL_CODE); } //随机数 @@ -1808,13 +1808,13 @@ public class AuthUserServiceImpl extends ServiceImpl im try { boolean sendSmsSuccess = DySmsHelper.sendSms(phone, obj, DySmsEnum.LOGIN_TEMPLATE_CODE); if(!sendSmsSuccess){ - throw new STASException("短信验证码发送失败,请稍后重试!"); + throw new JeecgBootException("短信验证码发送失败,请稍后重试!"); } //验证码10分钟内有效 redisUtil.set(redisKey, captcha, 600); } catch (ClientException e) { log.error(e.getMessage(),e); - throw new STASException("短信接口未配置,请联系管理员!"); + throw new JeecgBootException("短信接口未配置,请联系管理员!"); } } } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java index 9a604a3..f15954e 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java @@ -26,7 +26,7 @@ import org.jeecg.common.constant.enums.EmailTemplateEnum; import org.jeecg.common.constant.enums.MessageTypeEnum; import org.jeecg.common.constant.enums.SysAnnmentTypeEnum; import org.jeecg.common.desensitization.util.SensitiveInfoUtil; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.system.api.ISysBaseAPI; import org.jeecg.common.system.query.QueryCondition; import org.jeecg.common.system.query.QueryGenerator; @@ -447,7 +447,7 @@ public class SysBaseApiImpl implements ISysBaseAPI { List sysSmsTemplates = sysMessageTemplateService.selectByCode(templateCode); if(sysSmsTemplates==null||sysSmsTemplates.size()==0){ - throw new STASException("消息模板不存在,模板编码:"+templateCode); + throw new JeecgBootException("消息模板不存在,模板编码:"+templateCode); } SysMessageTemplate sysSmsTemplate = sysSmsTemplates.get(0); //模板标题 @@ -516,7 +516,7 @@ public class SysBaseApiImpl implements ISysBaseAPI { List sysSmsTemplates = sysMessageTemplateService.selectByCode(templateCode); if(sysSmsTemplates==null||sysSmsTemplates.size()==0){ - throw new STASException("消息模板不存在,模板编码:"+templateCode); + throw new JeecgBootException("消息模板不存在,模板编码:"+templateCode); } SysMessageTemplate sysSmsTemplate = sysSmsTemplates.get(0); //模板标题 @@ -587,7 +587,7 @@ public class SysBaseApiImpl implements ISysBaseAPI { Map map = templateDTO.getTemplateParam(); List sysSmsTemplates = sysMessageTemplateService.selectByCode(templateCode); if(sysSmsTemplates==null||sysSmsTemplates.size()==0){ - throw new STASException("消息模板不存在,模板编码:"+templateCode); + throw new JeecgBootException("消息模板不存在,模板编码:"+templateCode); } SysMessageTemplate sysSmsTemplate = sysSmsTemplates.get(0); //模板内容 @@ -1564,7 +1564,7 @@ public class SysBaseApiImpl implements ISysBaseAPI { } if(oConvertUtils.isEmpty(message.getContent())){ log.error("发送消息失败,消息内容为空!"); - throw new STASException("发送消息失败,消息内容为空!"); + throw new JeecgBootException("发送消息失败,消息内容为空!"); } //update-end-author:taoyan date:2022-7-9 for: 将模板解析代码移至消息发送, 而不是调用的地方 diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysCategoryServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysCategoryServiceImpl.java index a88b05d..34874a4 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysCategoryServiceImpl.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysCategoryServiceImpl.java @@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.jeecg.common.constant.FillRuleConstant; import org.jeecg.common.constant.SymbolConstant; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.util.FillRuleUtil; import org.jeecg.common.util.oConvertUtils; import org.jeecg.modules.system.entity.SysCategory; @@ -73,15 +73,15 @@ public class SysCategoryServiceImpl extends ServiceImpl queryListByCode(String pcode) throws STASException { + public List queryListByCode(String pcode) throws JeecgBootException { String pid = ROOT_PID_VALUE; if(oConvertUtils.isNotEmpty(pcode)) { List list = baseMapper.selectList(new LambdaQueryWrapper().eq(SysCategory::getCode, pcode)); if(list==null || list.size() ==0) { - throw new STASException("该编码【"+pcode+"】不存在,请核实!"); + throw new JeecgBootException("该编码【"+pcode+"】不存在,请核实!"); } if(list.size()>1) { - throw new STASException("该编码【"+pcode+"】存在多个,请核实!"); + throw new JeecgBootException("该编码【"+pcode+"】存在多个,请核实!"); } pid = list.get(0).getId(); } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysCommentServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysCommentServiceImpl.java index 68e1e37..216ecdd 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysCommentServiceImpl.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysCommentServiceImpl.java @@ -10,7 +10,7 @@ import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.SymbolConstant; import org.jeecg.common.constant.enums.FileTypeEnum; import org.jeecg.common.constant.enums.MessageTypeEnum; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.system.api.ISysBaseAPI; import org.jeecg.common.system.vo.SysFilesModel; import org.jeecg.common.util.CommonUtils; @@ -127,7 +127,7 @@ public class SysCommentServiceImpl extends ServiceImpl impl }catch(MyBatisSystemException e){ log.error(e.getMessage(), e); String errorCause = "查询异常,请检查唯一校验的配置!"; - throw new STASException(errorCause); + throw new JeecgBootException(errorCause); } // 4.返回结果 @@ -829,11 +829,11 @@ public class SysDictServiceImpl extends ServiceImpl impl String id = sysDictVo.getId(); SysDict dict = baseMapper.selectById(id); if(null == dict){ - throw new STASException("字典数据不存在"); + throw new JeecgBootException("字典数据不存在"); } //判断应用id和数据库中的是否一致,不一致不让修改 if(!dict.getLowAppId().equals(sysDictVo.getLowAppId())){ - throw new STASException("字典数据不存在"); + throw new JeecgBootException("字典数据不存在"); } SysDict sysDict = new SysDict(); sysDict.setDictName(sysDictVo.getDictName()); diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysPermissionServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysPermissionServiceImpl.java index 70efe67..477fd9e 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysPermissionServiceImpl.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysPermissionServiceImpl.java @@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.jeecg.common.constant.CacheConstant; import org.jeecg.common.constant.CommonConstant; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.util.oConvertUtils; import org.jeecg.config.mybatis.MybatisPlusSaasConfig; import org.jeecg.modules.system.entity.SysPermission; @@ -78,10 +78,10 @@ public class SysPermissionServiceImpl extends ServiceImpl().lambda().eq(SysPermission::getParentId, pid)); @@ -170,7 +170,7 @@ public class SysPermissionServiceImpl extends ServiceImpl impl query.eq(SysRole::getRoleCode,"admin"); Long adminRoleCount = sysRoleMapper.selectCount(query); if(adminRoleCount>0){ - throw new STASException("admin角色,不允许删除!"); + throw new JeecgBootException("admin角色,不允许删除!"); } } } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysTableWhiteListServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysTableWhiteListServiceImpl.java index cc6239b..1bab18b 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysTableWhiteListServiceImpl.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysTableWhiteListServiceImpl.java @@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.constant.CommonConstant; -import org.jeecg.common.exception.STASException; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.util.oConvertUtils; import org.jeecg.config.firewall.SqlInjection.IDictTableWhiteListHandler; import org.jeecg.modules.system.entity.SysTableWhiteList; @@ -59,13 +59,13 @@ public class SysTableWhiteListServiceImpl extends ServiceImpl