From 8ee740ef49d6245e05d2a4fd76b762001d274a77 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 6 Jul 2023 22:07:00 +0800 Subject: [PATCH 1/5] update sql --- sql/{ry_20230223.sql => ry_20230706.sql} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename sql/{ry_20230223.sql => ry_20230706.sql} (98%) diff --git a/sql/ry_20230223.sql b/sql/ry_20230706.sql similarity index 98% rename from sql/ry_20230223.sql rename to sql/ry_20230706.sql index 45c2ebb7..e4f4f69b 100644 --- a/sql/ry_20230223.sql +++ b/sql/ry_20230706.sql @@ -674,7 +674,7 @@ create table gen_table ( drop table if exists gen_table_column; create table gen_table_column ( column_id bigint(20) not null auto_increment comment '编号', - table_id varchar(64) comment '归属表编号', + table_id bigint(20) comment '归属表编号', column_name varchar(200) comment '列名称', column_comment varchar(500) comment '列描述', column_type varchar(100) comment '列类型', From 4d5c204b9aa4b8ba0e42d20a73f5bd3de9ed73d2 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 6 Jul 2023 22:08:47 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/common/utils/DateUtils.java | 2 +- .../web/exception/GlobalExceptionHandler.java | 24 +++++++++++++++++++ ruoyi-ui/vue.config.js | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java index 04c87d8a..20dbbb74 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java @@ -147,7 +147,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils /** * 计算时间差 * - * @param endTime 最后时间 + * @param endDate 最后时间 * @param startTime 开始时间 * @return 时间差(天/小时/分钟) */ diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java index bf0a7ed8..d4d64212 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java @@ -7,8 +7,10 @@ import org.springframework.security.access.AccessDeniedException; import org.springframework.validation.BindException; import org.springframework.web.HttpRequestMethodNotSupportedException; import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.MissingPathVariableException; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException; import com.ruoyi.common.constant.HttpStatus; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.exception.DemoModeException; @@ -59,6 +61,28 @@ public class GlobalExceptionHandler return StringUtils.isNotNull(code) ? AjaxResult.error(code, e.getMessage()) : AjaxResult.error(e.getMessage()); } + /** + * 请求路径中缺少必需的路径变量 + */ + @ExceptionHandler(MissingPathVariableException.class) + public AjaxResult handleMissingPathVariableException(MissingPathVariableException e, HttpServletRequest request) + { + String requestURI = request.getRequestURI(); + log.error("请求路径中缺少必需的路径变量'{}',发生系统异常.", requestURI, e); + return AjaxResult.error(String.format("请求路径中缺少必需的路径变量[%s]", e.getVariableName())); + } + + /** + * 请求参数类型不匹配 + */ + @ExceptionHandler(MethodArgumentTypeMismatchException.class) + public AjaxResult handleMethodArgumentTypeMismatchException(MethodArgumentTypeMismatchException e, HttpServletRequest request) + { + String requestURI = request.getRequestURI(); + log.error("请求参数类型不匹配'{}',发生系统异常.", requestURI, e); + return AjaxResult.error(String.format("请求参数类型不匹配,参数[%s]要求类型为:'%s',但输入值为:'%s'", e.getName(), e.getRequiredType().getName(), e.getValue())); + } + /** * 拦截未知的运行时异常 */ diff --git a/ruoyi-ui/vue.config.js b/ruoyi-ui/vue.config.js index b0f1d75f..cfc179bb 100644 --- a/ruoyi-ui/vue.config.js +++ b/ruoyi-ui/vue.config.js @@ -112,7 +112,7 @@ module.exports = { elementUI: { name: 'chunk-elementUI', // split elementUI into a single package test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm - priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app + priority: 20 // the weight needs to be larger than libs and app or it will be packaged into libs or app }, commons: { name: 'chunk-commons', From 1ffb6379f7c520358760550605f3ede90b74da26 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 6 Jul 2023 22:09:02 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=8E=92=E5=BA=8F=E5=B1=9E=E6=80=A7orderBy?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=99=90=E5=88=B6=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/common/utils/sql/SqlUtil.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java index 40a800da..9f40118c 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java @@ -20,6 +20,11 @@ public class SqlUtil */ public static String SQL_PATTERN = "[a-zA-Z0-9_\\ \\,\\.]+"; + /** + * 限制orderBy最大长度 + */ + private static final int ORDER_BY_MAX_LENGTH = 500; + /** * 检查字符,防止注入绕过 */ @@ -29,6 +34,10 @@ public class SqlUtil { throw new UtilException("参数不符合规范,不能进行查询"); } + if (StringUtils.length(value) > ORDER_BY_MAX_LENGTH) + { + throw new UtilException("参数已超过最大限制,不能进行查询"); + } return value; } From a0595711cade032e6b5c433e093371370796c413 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 6 Jul 2023 22:09:16 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A1=B5=E7=AD=BE?= =?UTF-8?q?=E5=9C=A8Firefox=E6=B5=8F=E8=A7=88=E5=99=A8=E8=A2=AB=E9=81=AE?= =?UTF-8?q?=E6=8C=A1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/layout/components/TagsView/ScrollPane.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-ui/src/layout/components/TagsView/ScrollPane.vue b/ruoyi-ui/src/layout/components/TagsView/ScrollPane.vue index f92d99b7..bb753a12 100644 --- a/ruoyi-ui/src/layout/components/TagsView/ScrollPane.vue +++ b/ruoyi-ui/src/layout/components/TagsView/ScrollPane.vue @@ -87,7 +87,7 @@ export default { bottom: 0px; } .el-scrollbar__wrap { - height: 39px; + height: 49px; } } } From 2517e9dddb87b8392b9d03401cdb8c4e1ff0b5ad Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 24 Jul 2023 15:16:52 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF(I6ADCR)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/web/service/UserDetailsServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/UserDetailsServiceImpl.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/UserDetailsServiceImpl.java index 234a502e..e294fbd2 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/UserDetailsServiceImpl.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/UserDetailsServiceImpl.java @@ -11,6 +11,7 @@ import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.enums.UserStatus; import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.MessageUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.service.ISysUserService; @@ -40,17 +41,17 @@ public class UserDetailsServiceImpl implements UserDetailsService if (StringUtils.isNull(user)) { log.info("登录用户:{} 不存在.", username); - throw new ServiceException("登录用户:" + username + " 不存在"); + throw new ServiceException(MessageUtils.message("user.not.exists")); } else if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) { log.info("登录用户:{} 已被删除.", username); - throw new ServiceException("对不起,您的账号:" + username + " 已被删除"); + throw new ServiceException(MessageUtils.message("user.password.delete")); } else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { log.info("登录用户:{} 已被停用.", username); - throw new ServiceException("对不起,您的账号:" + username + " 已停用"); + throw new ServiceException(MessageUtils.message("user.blocked")); } passwordService.validate(user);