From 7a112c7317e9f0e55c4ca86b14533c84448ee0d9 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 21 Nov 2022 12:32:09 +0800 Subject: [PATCH 01/46] =?UTF-8?q?=E5=85=BC=E5=AE=B9Excel=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A1=86=E5=86=85=E5=AE=B9=E8=BF=87=E5=A4=9A=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/core/utils/poi/ExcelUtil.java | 65 ++++++++++++++++++- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java index 2d64b229..05ce1b76 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java @@ -37,6 +37,7 @@ import org.apache.poi.ss.usermodel.FillPatternType; import org.apache.poi.ss.usermodel.Font; import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.ss.usermodel.Name; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.VerticalAlignment; @@ -855,8 +856,16 @@ public class ExcelUtil } if (StringUtils.isNotEmpty(attr.prompt()) || attr.combo().length > 0) { - // 提示信息或只能选择不能输入的列内容. - setPromptOrValidation(sheet, attr.combo(), attr.prompt(), 1, 100, column, column); + if (attr.combo().length > 15 || StringUtils.join(attr.combo()).length() > 255) + { + // 如果下拉数大于15或字符串长度大于255,则使用一个新sheet存储,避免生成的模板下拉值获取不到 + setXSSFValidationWithHidden(sheet, attr.combo(), attr.prompt(), 1, 100, column, column); + } + else + { + // 提示信息或只能选择不能输入的列内容. + setPromptOrValidation(sheet, attr.combo(), attr.prompt(), 1, 100, column, column); + } } } @@ -955,6 +964,58 @@ public class ExcelUtil sheet.addValidationData(dataValidation); } + /** + * 设置某些列的值只能输入预制的数据,显示下拉框(兼容超出一定数量的下拉框). + * + * @param sheet 要设置的sheet. + * @param textlist 下拉框显示的内容 + * @param promptContent 提示内容 + * @param firstRow 开始行 + * @param endRow 结束行 + * @param firstCol 开始列 + * @param endCol 结束列 + */ + public void setXSSFValidationWithHidden(Sheet sheet, String[] textlist, String promptContent, int firstRow, int endRow, int firstCol, int endCol) + { + String hideSheetName = "combo_" + firstCol + "_" + endCol; + Sheet hideSheet = wb.createSheet(hideSheetName); // 用于存储 下拉菜单数据 + for (int i = 0; i < textlist.length; i++) + { + hideSheet.createRow(i).createCell(0).setCellValue(textlist[i]); + } + // 创建名称,可被其他单元格引用 + Name name = wb.createName(); + name.setNameName(hideSheetName + "_data"); + name.setRefersToFormula(hideSheetName + "!$A$1:$A$" + textlist.length); + DataValidationHelper helper = sheet.getDataValidationHelper(); + // 加载下拉列表内容 + DataValidationConstraint constraint = helper.createFormulaListConstraint(hideSheetName + "_data"); + // 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列 + CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); + // 数据有效性对象 + DataValidation dataValidation = helper.createValidation(constraint, regions); + if (StringUtils.isNotEmpty(promptContent)) + { + // 如果设置了提示信息则鼠标放上去提示 + dataValidation.createPromptBox("", promptContent); + dataValidation.setShowPromptBox(true); + } + // 处理Excel兼容性问题 + if (dataValidation instanceof XSSFDataValidation) + { + dataValidation.setSuppressDropDownArrow(true); + dataValidation.setShowErrorBox(true); + } + else + { + dataValidation.setSuppressDropDownArrow(false); + } + + sheet.addValidationData(dataValidation); + // 设置hiddenSheet隐藏 + wb.setSheetHidden(wb.getSheetIndex(hideSheet), true); + } + /** * 解析导出值 0=男,1=女,2=未知 * From bc1c1dbfa7640856d57d6538056d7e98f43d1dbc Mon Sep 17 00:00:00 2001 From: ylwang Date: Mon, 21 Nov 2022 08:58:44 +0000 Subject: [PATCH 02/46] =?UTF-8?q?=E6=AD=A4=E5=A4=84=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=9B=BE=E5=AF=BC=E8=87=B4=20nacos=E4=BF=AE=E6=94=B9xss?= =?UTF-8?q?=E5=BC=80=E5=85=B3=E6=97=B6=EF=BC=8Cspring=E5=AE=B9=E5=99=A8?= =?UTF-8?q?=E6=9C=AA=E9=87=8D=E5=90=AF=EF=BC=8Cfilter=E4=BB=8D=E8=B5=B7?= =?UTF-8?q?=E6=95=88=E3=80=82=E6=95=85=E5=A2=9E=E5=8A=A0=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=88=A4=E6=96=AD=EF=BC=8C=E5=8F=82=E6=95=B0=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E5=90=8E=EF=BC=8Cxss=E5=BC=80=E5=85=B3=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E3=80=82=20=E6=AD=A4=E5=A4=84=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=9B=BE=E5=AF=BC=E8=87=B4=20nacos=E4=BF=AE=E6=94=B9x?= =?UTF-8?q?ss=E5=BC=80=E5=85=B3=E6=97=B6=EF=BC=8Cspring=E5=AE=B9=E5=99=A8?= =?UTF-8?q?=E6=9C=AA=E9=87=8D=E5=90=AF=EF=BC=8Cfilter=E4=BB=8D=E8=B5=B7?= =?UTF-8?q?=E6=95=88=E3=80=82=E6=95=85=E5=A2=9E=E5=8A=A0=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=88=A4=E6=96=AD=EF=BC=8C=E5=8F=82=E6=95=B0=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E5=90=8E=EF=BC=8Cxss=E5=BC=80=E5=85=B3=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ylwang --- .../src/main/java/com/ruoyi/gateway/filter/XssFilter.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/XssFilter.java b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/XssFilter.java index bc93e3a8..76792ee4 100644 --- a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/XssFilter.java +++ b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/XssFilter.java @@ -42,6 +42,10 @@ public class XssFilter implements GlobalFilter, Ordered public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) { ServerHttpRequest request = exchange.getRequest(); + // xss开关未开启 或 通过nacos关闭,不过滤 + if(!xss.getEnabled()){ + return chain.filter(exchange); + } // GET DELETE 不过滤 HttpMethod method = request.getMethod(); if (method == null || method == HttpMethod.GET || method == HttpMethod.DELETE) From b1a67a113e03f56345afdd8ef91cfa7c2529ec65 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 21 Nov 2022 19:46:47 +0800 Subject: [PATCH 03/46] =?UTF-8?q?=E6=B6=88=E9=99=A4Vue3=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=8F=B0=E5=87=BA=E7=8E=B0=E7=9A=84=E8=AD=A6=E5=91=8A=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/system/api/domain/SysRole.java | 9 +- .../resources/vm/vue/v3/index-tree.vue.vm | 21 +--- .../src/main/resources/vm/vue/v3/index.vue.vm | 14 +-- .../com/ruoyi/job/config/ScheduleConfig.java | 114 +++++++++--------- .../java/com/ruoyi/system/domain/SysPost.java | 9 +- .../resources/mapper/system/SysPostMapper.xml | 6 +- .../resources/mapper/system/SysRoleMapper.xml | 6 +- 7 files changed, 78 insertions(+), 101 deletions(-) diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java index 04a4d0ef..f224b422 100644 --- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java @@ -2,6 +2,7 @@ package com.ruoyi.system.api.domain; import java.util.Set; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -32,7 +33,7 @@ public class SysRole extends BaseEntity /** 角色排序 */ @Excel(name = "角色排序") - private String roleSort; + private Integer roleSort; /** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */ @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限") @@ -117,13 +118,13 @@ public class SysRole extends BaseEntity this.roleKey = roleKey; } - @NotBlank(message = "显示顺序不能为空") - public String getRoleSort() + @NotNull(message = "显示顺序不能为空") + public Integer getRoleSort() { return roleSort; } - public void setRoleSort(String roleSort) + public void setRoleSort(Integer roleSort) { this.roleSort = roleSort; } diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index-tree.vue.vm b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index-tree.vue.vm index 862297c7..1294525e 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index-tree.vue.vm +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index-tree.vue.vm @@ -136,24 +136,9 @@ #end diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index.vue.vm b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index.vue.vm index f66cc3b8..8fae4493 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index.vue.vm +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index.vue.vm @@ -148,18 +148,8 @@ #end diff --git a/ruoyi-modules/ruoyi-job/src/main/java/com/ruoyi/job/config/ScheduleConfig.java b/ruoyi-modules/ruoyi-job/src/main/java/com/ruoyi/job/config/ScheduleConfig.java index d0026864..fb4086e1 100644 --- a/ruoyi-modules/ruoyi-job/src/main/java/com/ruoyi/job/config/ScheduleConfig.java +++ b/ruoyi-modules/ruoyi-job/src/main/java/com/ruoyi/job/config/ScheduleConfig.java @@ -1,57 +1,57 @@ -package com.ruoyi.job.config; - -import java.util.Properties; -import javax.sql.DataSource; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.quartz.SchedulerFactoryBean; - -/** - * 定时任务配置(单机部署建议删除此类和qrtz数据库表,默认走内存会最高效) - * - * @author ruoyi - */ -@Configuration -public class ScheduleConfig -{ - @Bean - public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource) - { - SchedulerFactoryBean factory = new SchedulerFactoryBean(); - factory.setDataSource(dataSource); - - // quartz参数 - Properties prop = new Properties(); - prop.put("org.quartz.scheduler.instanceName", "RuoyiScheduler"); - prop.put("org.quartz.scheduler.instanceId", "AUTO"); - // 线程池配置 - prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool"); - prop.put("org.quartz.threadPool.threadCount", "20"); - prop.put("org.quartz.threadPool.threadPriority", "5"); - // JobStore配置 - prop.put("org.quartz.jobStore.class", "org.springframework.scheduling.quartz.LocalDataSourceJobStore"); - // 集群配置 - prop.put("org.quartz.jobStore.isClustered", "true"); - prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000"); - prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1"); - prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true"); - - // sqlserver 启用 - // prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?"); - prop.put("org.quartz.jobStore.misfireThreshold", "12000"); - prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_"); - factory.setQuartzProperties(prop); - - factory.setSchedulerName("RuoyiScheduler"); - // 延时启动 - factory.setStartupDelay(1); - factory.setApplicationContextSchedulerContextKey("applicationContextKey"); - // 可选,QuartzScheduler - // 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了 - factory.setOverwriteExistingJobs(true); - // 设置自动启动,默认为true - factory.setAutoStartup(true); - - return factory; - } -} +//package com.ruoyi.job.config; +// +//import java.util.Properties; +//import javax.sql.DataSource; +//import org.springframework.context.annotation.Bean; +//import org.springframework.context.annotation.Configuration; +//import org.springframework.scheduling.quartz.SchedulerFactoryBean; +// +///** +// * 定时任务配置(单机部署建议删除此类和qrtz数据库表,默认走内存会最高效) +// * +// * @author ruoyi +// */ +//@Configuration +//public class ScheduleConfig +//{ +// @Bean +// public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource) +// { +// SchedulerFactoryBean factory = new SchedulerFactoryBean(); +// factory.setDataSource(dataSource); +// +// // quartz参数 +// Properties prop = new Properties(); +// prop.put("org.quartz.scheduler.instanceName", "RuoyiScheduler"); +// prop.put("org.quartz.scheduler.instanceId", "AUTO"); +// // 线程池配置 +// prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool"); +// prop.put("org.quartz.threadPool.threadCount", "20"); +// prop.put("org.quartz.threadPool.threadPriority", "5"); +// // JobStore配置 +// prop.put("org.quartz.jobStore.class", "org.springframework.scheduling.quartz.LocalDataSourceJobStore"); +// // 集群配置 +// prop.put("org.quartz.jobStore.isClustered", "true"); +// prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000"); +// prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1"); +// prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true"); +// +// // sqlserver 启用 +// // prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?"); +// prop.put("org.quartz.jobStore.misfireThreshold", "12000"); +// prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_"); +// factory.setQuartzProperties(prop); +// +// factory.setSchedulerName("RuoyiScheduler"); +// // 延时启动 +// factory.setStartupDelay(1); +// factory.setApplicationContextSchedulerContextKey("applicationContextKey"); +// // 可选,QuartzScheduler +// // 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了 +// factory.setOverwriteExistingJobs(true); +// // 设置自动启动,默认为true +// factory.setAutoStartup(true); +// +// return factory; +// } +//} diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java index b5a1e9d3..7c03fbde 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java @@ -1,6 +1,7 @@ package com.ruoyi.system.domain; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -31,7 +32,7 @@ public class SysPost extends BaseEntity /** 岗位排序 */ @Excel(name = "岗位排序") - private String postSort; + private Integer postSort; /** 状态(0正常 1停用) */ @Excel(name = "状态", readConverterExp = "0=正常,1=停用") @@ -74,13 +75,13 @@ public class SysPost extends BaseEntity this.postName = postName; } - @NotBlank(message = "显示顺序不能为空") - public String getPostSort() + @NotNull(message = "显示顺序不能为空") + public Integer getPostSort() { return postSort; } - public void setPostSort(String postSort) + public void setPostSort(Integer postSort) { this.postSort = postSort; } diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml index 2425ae05..faefb2f0 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml @@ -77,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" post_code = #{postCode}, post_name = #{postName}, - post_sort = #{postSort}, + post_sort = #{postSort}, status = #{status}, remark = #{remark}, update_by = #{updateBy}, @@ -91,7 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" post_id, post_code, post_name, - post_sort, + post_sort, status, remark, create_by, @@ -100,7 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{postId}, #{postCode}, #{postName}, - #{postSort}, + #{postSort}, #{status}, #{remark}, #{createBy}, diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml index 12e7f78e..ab601e4b 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml @@ -98,7 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" role_id, role_name, role_key, - role_sort, + role_sort, data_scope, menu_check_strictly, dept_check_strictly, @@ -110,7 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{roleId}, #{roleName}, #{roleKey}, - #{roleSort}, + #{roleSort}, #{dataScope}, #{menuCheckStrictly}, #{deptCheckStrictly}, @@ -126,7 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" role_name = #{roleName}, role_key = #{roleKey}, - role_sort = #{roleSort}, + role_sort = #{roleSort}, data_scope = #{dataScope}, menu_check_strictly = #{menuCheckStrictly}, dept_check_strictly = #{deptCheckStrictly}, From ee3f03f1f1de4581d7f0e94834018e6bb84f789f Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 22 Nov 2022 09:25:59 +0800 Subject: [PATCH 04/46] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E7=89=B9=E6=80=A7=E7=9A=84=E7=8E=AF=E5=A2=83=E7=94=9F=E6=88=90?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=8F=98=E4=B9=B1=E7=A0=81TXT=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/tool/gen/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruoyi-ui/src/views/tool/gen/index.vue b/ruoyi-ui/src/views/tool/gen/index.vue index eeb9efe5..b3a68f17 100644 --- a/ruoyi-ui/src/views/tool/gen/index.vue +++ b/ruoyi-ui/src/views/tool/gen/index.vue @@ -267,7 +267,7 @@ export default { this.$modal.msgSuccess("成功生成到自定义路径:" + row.genPath); }); } else { - this.$download.zip("/code/gen/batchGenCode?tables=" + tableNames, "ruoyi"); + this.$download.zip("/code/gen/batchGenCode?tables=" + tableNames, "ruoyi.zip"); } }, /** 同步数据库操作 */ @@ -305,7 +305,7 @@ export default { return result.value || ' '; }, /** 复制代码成功 */ - clipboardSuccess(){ + clipboardSuccess() { this.$modal.msgSuccess("复制成功"); }, // 多选框选中数据 From 04a042c585fd9c4ea1b7d61163d77c5f72a757f9 Mon Sep 17 00:00:00 2001 From: hjk2008 Date: Fri, 25 Nov 2022 09:32:35 +0000 Subject: [PATCH 05/46] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=20spring-boot-maven-plugin=20=E7=9A=84?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E9=BB=98=E8=AE=A4=E5=8E=BB=E6=8B=89?= =?UTF-8?q?=E5=8F=96=E5=9F=BA=E4=BA=8E=20JDK17=20=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E7=9A=84=203.0=20=E7=89=88=E6=9C=AC=E5=AF=BC=E8=87=B4=E6=89=93?= =?UTF-8?q?=E5=8C=85=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hjk2008 --- pom.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pom.xml b/pom.xml index 1ffa0c70..1f290b5c 100644 --- a/pom.xml +++ b/pom.xml @@ -263,6 +263,22 @@ + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + repackage + + + + + + From a8be0ccb35828ec333d5a88ff125db53739ba4ae Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 3 Dec 2022 13:20:48 +0800 Subject: [PATCH 06/46] =?UTF-8?q?=E4=BF=AE=E5=A4=8DLog=E6=B3=A8=E8=A7=A3GE?= =?UTF-8?q?T=E8=AF=B7=E6=B1=82=E8=AE=B0=E5=BD=95=E4=B8=8D=E5=88=B0?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/common/core/utils/ServletUtils.java | 31 +++++++++++++++++++ .../common/core/web/domain/AjaxResult.java | 8 ++--- .../ruoyi/common/log/aspect/LogAspect.java | 6 +++- .../com/ruoyi/gateway/filter/XssFilter.java | 3 +- .../service/impl/SysDeptServiceImpl.java | 6 +--- .../service/impl/SysMenuServiceImpl.java | 6 +--- 6 files changed, 44 insertions(+), 16 deletions(-) diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ServletUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ServletUtils.java index da36707b..cda37169 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ServletUtils.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ServletUtils.java @@ -4,8 +4,11 @@ import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.net.URLEncoder; +import java.util.Collections; import java.util.Enumeration; +import java.util.HashMap; import java.util.Map; +import javax.servlet.ServletRequest; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; @@ -79,6 +82,34 @@ public class ServletUtils return Convert.toBool(getRequest().getParameter(name), defaultValue); } + /** + * 获得所有请求参数 + * + * @param request 请求对象{@link ServletRequest} + * @return Map + */ + public static Map getParams(ServletRequest request) + { + final Map map = request.getParameterMap(); + return Collections.unmodifiableMap(map); + } + + /** + * 获得所有请求参数 + * + * @param request 请求对象{@link ServletRequest} + * @return Map + */ + public static Map getParamMap(ServletRequest request) + { + Map params = new HashMap<>(); + for (Map.Entry entry : getParams(request).entrySet()) + { + params.put(entry.getKey(), StringUtils.join(entry.getValue(), ",")); + } + return params; + } + /** * 获取request */ diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/domain/AjaxResult.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/domain/AjaxResult.java index c1e4b82d..583d35e1 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/domain/AjaxResult.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/domain/AjaxResult.java @@ -128,7 +128,7 @@ public class AjaxResult extends HashMap /** * 返回错误消息 * - * @return + * @return 错误消息 */ public static AjaxResult error() { @@ -139,7 +139,7 @@ public class AjaxResult extends HashMap * 返回错误消息 * * @param msg 返回内容 - * @return 警告消息 + * @return 错误消息 */ public static AjaxResult error(String msg) { @@ -151,7 +151,7 @@ public class AjaxResult extends HashMap * * @param msg 返回内容 * @param data 数据对象 - * @return 警告消息 + * @return 错误消息 */ public static AjaxResult error(String msg, Object data) { @@ -163,7 +163,7 @@ public class AjaxResult extends HashMap * * @param code 状态码 * @param msg 返回内容 - * @return 警告消息 + * @return 错误消息 */ public static AjaxResult error(int code, String msg) { diff --git a/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java index 45cf106d..f6b3a328 100644 --- a/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java +++ b/ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java @@ -102,7 +102,6 @@ public class LogAspect catch (Exception exp) { // 记录本地异常日志 - log.error("==前置通知异常=="); log.error("异常信息:{}", exp.getMessage()); exp.printStackTrace(); } @@ -150,6 +149,11 @@ public class LogAspect String params = argsArrayToString(joinPoint.getArgs()); operLog.setOperParam(StringUtils.substring(params, 0, 2000)); } + else + { + Map paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest()); + operLog.setOperParam(StringUtils.substring(JSON.toJSONString(paramsMap, excludePropertyPreFilter()), 0, 2000)); + } } /** diff --git a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/XssFilter.java b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/XssFilter.java index 76792ee4..66e8d400 100644 --- a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/XssFilter.java +++ b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/XssFilter.java @@ -43,7 +43,8 @@ public class XssFilter implements GlobalFilter, Ordered { ServerHttpRequest request = exchange.getRequest(); // xss开关未开启 或 通过nacos关闭,不过滤 - if(!xss.getEnabled()){ + if (!xss.getEnabled()) + { return chain.filter(exchange); } // GET DELETE 不过滤 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index 5aca64b2..08eaf72e 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -71,11 +71,7 @@ public class SysDeptServiceImpl implements ISysDeptService public List buildDeptTree(List depts) { List returnList = new ArrayList(); - List tempList = new ArrayList(); - for (SysDept dept : depts) - { - tempList.add(dept.getDeptId()); - } + List tempList = depts.stream().map(SysDept::getDeptId).collect(Collectors.toList()); for (SysDept dept : depts) { // 如果是顶级节点, 遍历该父节点的所有子节点 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java index c6e80294..1e700037 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java @@ -223,11 +223,7 @@ public class SysMenuServiceImpl implements ISysMenuService public List buildMenuTree(List menus) { List returnList = new ArrayList(); - List tempList = new ArrayList(); - for (SysMenu dept : menus) - { - tempList.add(dept.getMenuId()); - } + List tempList = menus.stream().map(SysMenu::getMenuId).collect(Collectors.toList()); for (Iterator iterator = menus.iterator(); iterator.hasNext();) { SysMenu menu = (SysMenu) iterator.next(); From 3d2f9aa9c6c450ddf46746cceced05bd7710fe30 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 3 Dec 2022 13:21:07 +0800 Subject: [PATCH 07/46] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E8=BF=87=E5=A4=9A=E5=B1=95=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E5=85=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/assets/styles/ruoyi.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ruoyi-ui/src/assets/styles/ruoyi.scss b/ruoyi-ui/src/assets/styles/ruoyi.scss index 78fa8bb1..c664395b 100644 --- a/ruoyi-ui/src/assets/styles/ruoyi.scss +++ b/ruoyi-ui/src/assets/styles/ruoyi.scss @@ -60,6 +60,10 @@ color: inherit; } +.el-message-box__status + .el-message-box__message{ + word-break: break-word; +} + .el-dialog:not(.is-fullscreen) { margin-top: 6vh !important; } From af33456ca89a9363f163ce1565285410c88bfe89 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 7 Dec 2022 12:43:12 +0800 Subject: [PATCH 08/46] =?UTF-8?q?=E5=8D=87=E7=BA=A7echarts=E5=88=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=AC5.4.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/package.json | 2 +- ruoyi-ui/src/components/RightPanel/index.vue | 6 ------ ruoyi-ui/src/views/dashboard/BarChart.vue | 2 +- ruoyi-ui/src/views/dashboard/LineChart.vue | 2 +- ruoyi-ui/src/views/dashboard/PieChart.vue | 2 +- ruoyi-ui/src/views/dashboard/RaddarChart.vue | 2 +- 6 files changed, 5 insertions(+), 11 deletions(-) diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index 6cebf701..5820ec07 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -40,7 +40,7 @@ "axios": "0.24.0", "clipboard": "2.0.8", "core-js": "3.25.3", - "echarts": "4.9.0", + "echarts": "5.4.0", "element-ui": "2.15.10", "file-saver": "2.0.5", "fuse.js": "6.4.3", diff --git a/ruoyi-ui/src/components/RightPanel/index.vue b/ruoyi-ui/src/components/RightPanel/index.vue index 42b5a6be..25ce3f81 100644 --- a/ruoyi-ui/src/components/RightPanel/index.vue +++ b/ruoyi-ui/src/components/RightPanel/index.vue @@ -39,7 +39,6 @@ export default { } }, mounted() { - this.insertToBody() this.addEventClick() }, beforeDestroy() { @@ -56,11 +55,6 @@ export default { this.show = false window.removeEventListener('click', this.closeSidebar) } - }, - insertToBody() { - const elx = this.$refs.rightPanel - const body = document.querySelector('body') - body.insertBefore(elx, body.firstChild) } } } diff --git a/ruoyi-ui/src/views/dashboard/BarChart.vue b/ruoyi-ui/src/views/dashboard/BarChart.vue index 6b464e1c..116a4317 100644 --- a/ruoyi-ui/src/views/dashboard/BarChart.vue +++ b/ruoyi-ui/src/views/dashboard/BarChart.vue @@ -3,7 +3,7 @@ From 33a0806cbee39162b49951a337ed01d6666c5d6c Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 18 Mar 2023 10:43:52 +0800 Subject: [PATCH 42/46] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E5=90=8E=E5=AF=BC=E8=88=AA=E6=A0=8F=E5=81=8F=E7=A7=BB=E7=9A=84?= =?UTF-8?q?=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/AppMain.vue | 9 ------ ruoyi-ui/src/layout/index.vue | 32 ++++++++++++++-------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/ruoyi-ui/src/layout/components/AppMain.vue b/ruoyi-ui/src/layout/components/AppMain.vue index 25d5a25a..55804bbe 100644 --- a/ruoyi-ui/src/layout/components/AppMain.vue +++ b/ruoyi-ui/src/layout/components/AppMain.vue @@ -50,12 +50,3 @@ export default { } } - - diff --git a/ruoyi-ui/src/layout/index.vue b/ruoyi-ui/src/layout/index.vue index 202cfcd6..5e00d642 100644 --- a/ruoyi-ui/src/layout/index.vue +++ b/ruoyi-ui/src/layout/index.vue @@ -1,17 +1,19 @@ @@ -72,6 +74,14 @@ export default { height: 100%; width: 100%; + .el-scrollbar{ + height: 100%; + } + + ::v-deep .el-scrollbar__wrap { + overflow-x: hidden; + } + &.mobile.openSidebar { position: fixed; top: 0; From feff4196413820bac23eff738ba304e86fa2ca14 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 18 Mar 2023 10:44:37 +0800 Subject: [PATCH 43/46] =?UTF-8?q?=E5=85=B3=E9=97=AD=E9=A1=B5=E7=AD=BE?= =?UTF-8?q?=E5=90=8E=E5=AD=98=E5=9C=A8=E5=85=B6=E4=BB=96=E9=A1=B5=E7=AD=BE?= =?UTF-8?q?=E6=97=B6=E4=B8=8D=E5=BA=94=E8=AF=A5=E8=B7=B3=E8=BD=AC=E9=A6=96?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/plugins/tab.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ruoyi-ui/src/plugins/tab.js b/ruoyi-ui/src/plugins/tab.js index 5e8b834a..60ceb5fa 100644 --- a/ruoyi-ui/src/plugins/tab.js +++ b/ruoyi-ui/src/plugins/tab.js @@ -32,8 +32,12 @@ export default { // 关闭指定tab页签 closePage(obj) { if (obj === undefined) { - return store.dispatch('tagsView/delView', router.currentRoute).then(({ lastPath }) => { - return router.push(lastPath || '/'); + return store.dispatch('tagsView/delView', router.currentRoute).then(({ visitedViews }) => { + const latestView = visitedViews.slice(-1)[0] + if (latestView) { + return router.push(latestView.fullPath) + } + return router.push('/'); }); } return store.dispatch('tagsView/delView', obj); From f8ad7ea3ce00e35e8bd9bb17258153714f03d711 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 18 Mar 2023 10:45:29 +0800 Subject: [PATCH 44/46] =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E9=9A=90=E8=97=8F=E5=B1=9E=E6=80=A7=E5=88=97=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=AD=90=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java index 05ce1b76..ebef67e1 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java @@ -1257,7 +1257,8 @@ public class ExcelUtil Excel[] excels = attrs.value(); for (Excel attr : excels) { - if (attr != null && (attr.type() == Type.ALL || attr.type() == type)) + if (!ArrayUtils.contains(this.excludeFields, field.getName() + "." + attr.targetAttr()) + && (attr != null && (attr.type() == Type.ALL || attr.type() == type))) { field.setAccessible(true); fields.add(new Object[] { field, attr }); From b155059d667b7826972e159c2cd070c4f97445fd Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 18 Mar 2023 10:45:57 +0800 Subject: [PATCH 45/46] =?UTF-8?q?=E5=8D=87=E7=BA=A7fastjson=E5=88=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=882.0.25?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 90070003..b613ba96 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ 3.5.2 2.11.0 2.3 - 2.0.23 + 2.0.25 0.9.1 8.2.2 4.1.2 From 05ca78e82fb4e074760156359d09aefbf14a375c Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 18 Mar 2023 10:51:46 +0800 Subject: [PATCH 46/46] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E7=BE=A4?= =?UTF-8?q?=E5=8F=B7=EF=BC=9A101038945?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- ruoyi-ui/src/views/index.vue | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1b151036..67070b0e 100644 --- a/README.md +++ b/README.md @@ -128,4 +128,4 @@ com.ruoyi ## 若依微服务交流群 -QQ群: [![加入QQ群](https://img.shields.io/badge/已满-42799195-blue.svg)](https://jq.qq.com/?_wv=1027&k=yqInfq0S) [![加入QQ群](https://img.shields.io/badge/已满-170157040-blue.svg)](https://jq.qq.com/?_wv=1027&k=Oy1mb3p8) [![加入QQ群](https://img.shields.io/badge/已满-130643120-blue.svg)](https://jq.qq.com/?_wv=1027&k=rvxkJtXK) [![加入QQ群](https://img.shields.io/badge/已满-225920371-blue.svg)](https://jq.qq.com/?_wv=1027&k=0Ck3PvTe) [![加入QQ群](https://img.shields.io/badge/已满-201705537-blue.svg)](https://jq.qq.com/?_wv=1027&k=FnHHP4TT) [![加入QQ群](https://img.shields.io/badge/已满-236543183-blue.svg)](https://jq.qq.com/?_wv=1027&k=qdT1Ojpz) [![加入QQ群](https://img.shields.io/badge/已满-213618602-blue.svg)](https://jq.qq.com/?_wv=1027&k=nw3OiyXs) [![加入QQ群](https://img.shields.io/badge/已满-148794840-blue.svg)](https://jq.qq.com/?_wv=1027&k=kiU5WDls) [![加入QQ群](https://img.shields.io/badge/118752664-blue.svg)](https://jq.qq.com/?_wv=1027&k=MtBy6YfT) 点击按钮入群。 \ No newline at end of file +QQ群: [![加入QQ群](https://img.shields.io/badge/已满-42799195-blue.svg)](https://jq.qq.com/?_wv=1027&k=yqInfq0S) [![加入QQ群](https://img.shields.io/badge/已满-170157040-blue.svg)](https://jq.qq.com/?_wv=1027&k=Oy1mb3p8) [![加入QQ群](https://img.shields.io/badge/已满-130643120-blue.svg)](https://jq.qq.com/?_wv=1027&k=rvxkJtXK) [![加入QQ群](https://img.shields.io/badge/已满-225920371-blue.svg)](https://jq.qq.com/?_wv=1027&k=0Ck3PvTe) [![加入QQ群](https://img.shields.io/badge/已满-201705537-blue.svg)](https://jq.qq.com/?_wv=1027&k=FnHHP4TT) [![加入QQ群](https://img.shields.io/badge/已满-236543183-blue.svg)](https://jq.qq.com/?_wv=1027&k=qdT1Ojpz) [![加入QQ群](https://img.shields.io/badge/已满-213618602-blue.svg)](https://jq.qq.com/?_wv=1027&k=nw3OiyXs) [![加入QQ群](https://img.shields.io/badge/已满-148794840-blue.svg)](https://jq.qq.com/?_wv=1027&k=kiU5WDls) [![加入QQ群](https://img.shields.io/badge/已满-118752664-blue.svg)](https://jq.qq.com/?_wv=1027&k=MtBy6YfT) [![加入QQ群](https://img.shields.io/badge/101038945-blue.svg)](https://jq.qq.com/?_wv=1027&k=FqImHgH2) 点击按钮入群。 \ No newline at end of file diff --git a/ruoyi-ui/src/views/index.vue b/ruoyi-ui/src/views/index.vue index a6f1630c..a5404ba7 100644 --- a/ruoyi-ui/src/views/index.vue +++ b/ruoyi-ui/src/views/index.vue @@ -118,10 +118,12 @@ >

- QQ群:满42799195 满170157040 - 满130643120 满225920371 满201705537 满236543183 - 满213618602 148794840 - 118752664 QQ群:满42799195 + 满170157040 满130643120 满225920371 + 满201705537 满236543183 满213618602 + 满148794840 满118752664 + 101038945