mirror of https://gitee.com/y_project/RuoYi.git
工具类异常使用UtilException
parent
c44c280b21
commit
22881ccb59
|
@ -1,6 +1,6 @@
|
||||||
package com.ruoyi.common.utils.sql;
|
package com.ruoyi.common.utils.sql;
|
||||||
|
|
||||||
import com.ruoyi.common.exception.base.BaseException;
|
import com.ruoyi.common.exception.UtilException;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -27,7 +27,7 @@ public class SqlUtil
|
||||||
{
|
{
|
||||||
if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value))
|
if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value))
|
||||||
{
|
{
|
||||||
throw new BaseException("参数不符合规范,不能进行查询");
|
throw new UtilException("参数不符合规范,不能进行查询");
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ public class SqlUtil
|
||||||
{
|
{
|
||||||
if (StringUtils.indexOfIgnoreCase(value, sqlKeywords[i]) > -1)
|
if (StringUtils.indexOfIgnoreCase(value, sqlKeywords[i]) > -1)
|
||||||
{
|
{
|
||||||
throw new BaseException("参数存在SQL注入风险");
|
throw new UtilException("参数存在SQL注入风险");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -222,7 +222,7 @@ public class GenController extends BaseController
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
logger.error(e.getMessage(), e);
|
logger.error(e.getMessage(), e);
|
||||||
return AjaxResult.error("创建表结构异常" + e.getMessage());
|
return AjaxResult.error("创建表结构异常[" + e.getMessage() + "]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue