From c2a179e9dd0bcc0b7f0607b0220d1264dae46461 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 20 Oct 2021 11:18:20 +0800 Subject: [PATCH 001/110] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E5=AF=B9=E8=B1=A1=E7=AE=80=E5=8C=96=E6=9D=83=E9=99=90=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/plugins/auth.js | 60 +++++++++++++++++++++++++++++++++++ ruoyi-ui/src/plugins/index.js | 3 ++ 2 files changed, 63 insertions(+) create mode 100644 ruoyi-ui/src/plugins/auth.js diff --git a/ruoyi-ui/src/plugins/auth.js b/ruoyi-ui/src/plugins/auth.js new file mode 100644 index 000000000..af740aaef --- /dev/null +++ b/ruoyi-ui/src/plugins/auth.js @@ -0,0 +1,60 @@ +import store from '@/store' + +function authPermission(permission) { + const all_permission = "*:*:*"; + const permissions = store.getters && store.getters.permissions + if (permission && permission.length > 0) { + return permissions.some(v => { + return all_permission === v || v === permission + }) + } else { + return false + } +} + +function authRole(role) { + const super_admin = "admin"; + const roles = store.getters && store.getters.roles + if (role && role.length > 0) { + return roles.some(v => { + return super_admin === v || v === role + }) + } else { + return false + } +} + +export default { + // 验证用户是否具备某权限 + hasPermi(permission) { + return authPermission(permission); + }, + // 验证用户是否含有指定权限,只需包含其中一个 + hasPermiOr(permissions) { + return permissions.some(item => { + return authPermission(item) + }) + }, + // 验证用户是否含有指定权限,必须全部拥有 + hasPermiAnd(permissions) { + return permissions.every(item => { + return authPermission(item) + }) + }, + // 验证用户是否具备某角色 + hasRole(role) { + return authRole(role); + }, + // 验证用户是否含有指定角色,只需包含其中一个 + hasRoleOr(roles) { + return roles.some(item => { + return authRole(item) + }) + }, + // 验证用户是否含有指定角色,必须全部拥有 + hasRoleAnd(roles) { + return roles.every(item => { + return authRole(item) + }) + } +} diff --git a/ruoyi-ui/src/plugins/index.js b/ruoyi-ui/src/plugins/index.js index a138e6d6f..7cc83a4c8 100644 --- a/ruoyi-ui/src/plugins/index.js +++ b/ruoyi-ui/src/plugins/index.js @@ -1,9 +1,12 @@ +import auth from './auth' import cache from './cache' import modal from './modal' import download from './download' export default { install(Vue) { + // 认证对象 + Vue.prototype.$auth = auth // 缓存对象 Vue.prototype.$cache = cache // 模态框对象 From 2d7d137abd0eb54a632ca2e18424348eab96cdd8 Mon Sep 17 00:00:00 2001 From: abbfun <819589789@qq.com> Date: Fri, 22 Oct 2021 03:09:54 +0000 Subject: [PATCH 002/110] =?UTF-8?q?update=20ruoyi-common/src/main/java/com?= =?UTF-8?q?/ruoyi/common/core/domain/AjaxResult.java.=20AjaxResult?= =?UTF-8?q?=E9=93=BE=E5=BC=8F=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/common/core/domain/AjaxResult.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java index b26e066ab..472afc868 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java @@ -145,4 +145,16 @@ public class AjaxResult extends HashMap { return new AjaxResult(code, msg, null); } + + /** + * 链式调用 + * + * @param key 键 + * @param value 内容 + * @return 警告消息 + */ + public AjaxResult put(String key, Object value) { + super.put(key, value); + return this; + } } From 3dbbc6a22360fa65c66609285f10bffc3a32334d Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 22 Oct 2021 16:23:08 +0800 Subject: [PATCH 003/110] =?UTF-8?q?AjaxResult=E9=87=8D=E5=86=99put?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E4=BB=A5=E6=96=B9=E4=BE=BF=E9=93=BE?= =?UTF-8?q?=E5=BC=8F=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/common/core/domain/AjaxResult.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java index 472afc868..8ca1b9b11 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java @@ -146,15 +146,17 @@ public class AjaxResult extends HashMap return new AjaxResult(code, msg, null); } - /** - * 链式调用 - * - * @param key 键 - * @param value 内容 - * @return 警告消息 - */ - public AjaxResult put(String key, Object value) { - super.put(key, value); - return this; - } + /** + * 方便链式调用 + * + * @param key 键 + * @param value 值 + * @return 数据对象 + */ + @Override + public AjaxResult put(String key, Object value) + { + super.put(key, value); + return this; + } } From ef4fef3d56f569d151ef71a9288e9973a19f4f6d Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 23 Oct 2021 10:21:02 +0800 Subject: [PATCH 004/110] update ry.sh. --- ry.bat | 26 +++++++++++++------------- ry.sh | 12 ++++-------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/ry.bat b/ry.bat index 5de3e1503..9f16232b2 100644 --- a/ry.bat +++ b/ry.bat @@ -4,36 +4,36 @@ rem jarƽ set AppName=ruoyi-admin.jar rem JVM -set JVM_OPTS="-Dname=%AppName% -Duser.timezone=Asia/Shanghai -Xms512M -Xmx512M -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC" +set JVM_OPTS="-Dname=%AppName% -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC" -ECHO. +ECHO. ECHO. [1] %AppName% ECHO. [2] ر%AppName% ECHO. [3] %AppName% ECHO. [4] ״̬ %AppName% - ECHO. [5] -ECHO. + ECHO. [5] +ECHO. ECHO.ѡĿ: set /p ID= - IF "%id%"=="1" GOTO start - IF "%id%"=="2" GOTO stop - IF "%id%"=="3" GOTO restart + IF "%id%"=="1" GOTO start + IF "%id%"=="2" GOTO stop + IF "%id%"=="3" GOTO restart IF "%id%"=="4" GOTO status IF "%id%"=="5" EXIT -PAUSE +PAUSE :start for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do ( set pid=%%a set image_name=%%b ) if defined pid ( - echo %%is running - PAUSE - ) + echo %%is running + PAUSE + ) -start javaw -jar %JAVA_OPTS% ruoyi-admin.jar +start javaw %JAVA_OPTS% -jar %AppName% echo starting echo Start %AppName% success... @@ -64,4 +64,4 @@ goto:eof if not defined pid (echo process %AppName% is dead ) else ( echo %image_name% is running ) -goto:eof \ No newline at end of file +goto:eof diff --git a/ry.sh b/ry.sh index 7c4f50385..d6a9cf33a 100644 --- a/ry.sh +++ b/ry.sh @@ -1,13 +1,9 @@ #!/bin/sh -# author ruoyi -# ./ry.sh start 启动 -# ./ry.sh stop 停止 -# ./ry.sh restart 重启 -# ./ry.sh status 状态 +# ./ry.sh start 启动 stop 停止 restart 重启 status 状态 AppName=ruoyi-admin.jar # JVM参数 -JVM_OPTS="-Dname=$AppName -Duser.timezone=Asia/Shanghai -Xms512M -Xmx512M -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC" +JVM_OPTS="-Dname=$AppName -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC" APP_HOME=`pwd` LOG_PATH=$APP_HOME/logs/$AppName.log @@ -30,7 +26,7 @@ function start() if [ x"$PID" != x"" ]; then echo "$AppName is running..." else - nohup java -jar $JVM_OPTS target/$AppName > /dev/null 2>&1 & + nohup java $JVM_OPTS -jar $AppName > /dev/null 2>&1 & echo "Start $AppName success..." fi } @@ -38,7 +34,7 @@ function start() function stop() { echo "Stop $AppName" - + PID="" query(){ PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'` From a4558c32b2b7630236f9f4323c79033879c1378b Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 23 Oct 2021 10:23:32 +0800 Subject: [PATCH 005/110] =?UTF-8?q?=E8=A7=A3=E6=9E=90blob=E5=93=8D?= =?UTF-8?q?=E5=BA=94=E6=98=AF=E5=90=A6=E7=99=BB=E5=BD=95=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/plugins/download.js | 45 +++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/ruoyi-ui/src/plugins/download.js b/ruoyi-ui/src/plugins/download.js index cb10ab0e4..2aa81229a 100644 --- a/ruoyi-ui/src/plugins/download.js +++ b/ruoyi-ui/src/plugins/download.js @@ -1,6 +1,7 @@ import { saveAs } from 'file-saver' import axios from 'axios' import { getToken } from '@/utils/auth' +import { Message } from 'element-ui' const baseURL = process.env.VUE_APP_BASE_API @@ -12,9 +13,14 @@ export default { url: url, responseType: 'blob', headers: { 'Authorization': 'Bearer ' + getToken() } - }).then(res => { - const blob = new Blob([res.data]) - this.saveAs(blob, decodeURI(res.headers['download-filename'])) + }).then(async (res) => { + const isLogin = await this.blobValidate(res.data); + if (isLogin) { + const blob = new Blob([res.data]) + this.saveAs(blob, decodeURI(res.headers['download-filename'])) + } else { + Message.error('无效的会话,或者会话已过期,请重新登录。'); + } }) }, resource(resource) { @@ -24,9 +30,14 @@ export default { url: url, responseType: 'blob', headers: { 'Authorization': 'Bearer ' + getToken() } - }).then(res => { - const blob = new Blob([res.data]) - this.saveAs(blob, decodeURI(res.headers['download-filename'])) + }).then(async (res) => { + const isLogin = await this.blobValidate(res.data); + if (isLogin) { + const blob = new Blob([res.data]) + this.saveAs(blob, decodeURI(res.headers['download-filename'])) + } else { + Message.error('无效的会话,或者会话已过期,请重新登录。'); + } }) }, zip(url, name) { @@ -36,13 +47,27 @@ export default { url: url, responseType: 'blob', headers: { 'Authorization': 'Bearer ' + getToken() } - }).then(res => { - const blob = new Blob([res.data], { type: 'application/zip' }) - this.saveAs(blob, name) + }).then(async (res) => { + const isLogin = await this.blobValidate(res.data); + if (isLogin) { + const blob = new Blob([res.data], { type: 'application/zip' }) + this.saveAs(blob, name) + } else { + Message.error('无效的会话,或者会话已过期,请重新登录。'); + } }) }, saveAs(text, name, opts) { saveAs(text, name, opts); - } + }, + async blobValidate(data) { + try { + const text = await data.text(); + JSON.parse(text); + return false; + } catch (error) { + return true; + } + }, } From 17550a5f4bd152bb67a0de2c1284e2eef243777c Mon Sep 17 00:00:00 2001 From: Remenber_Ray <343509740@qq.com> Date: Sun, 24 Oct 2021 02:34:25 +0000 Subject: [PATCH 006/110] =?UTF-8?q?update=20ruoyi-common/src/main/java/com?= =?UTF-8?q?/ruoyi/common/utils/Threads.java.=20=E4=BF=AE=E5=A4=8D=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-common/src/main/java/com/ruoyi/common/utils/Threads.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/Threads.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/Threads.java index 395920a24..f34935284 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/Threads.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/Threads.java @@ -36,7 +36,7 @@ public class Threads * 停止线程池 * 先使用shutdown, 停止接收新任务并尝试完成所有已存在任务. * 如果超时, 则调用shutdownNow, 取消在workQueue中Pending的任务,并中断所有阻塞函数. - * 如果仍人超時,則強制退出. + * 如果仍然超時,則強制退出. * 另对在shutdown时线程本身被调用中断做了处理. */ public static void shutdownAndAwaitTermination(ExecutorService pool) From 4583787759c30499cfb756615f9a10b4f7bbe281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Sun, 24 Oct 2021 17:13:04 +0800 Subject: [PATCH 007/110] =?UTF-8?q?fix=20=20=E8=B7=A8=E5=9F=9F=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E4=B9=8B=E5=90=8E=20=E4=B8=8B=E8=BD=BD=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=8E=B7=E5=8F=96=20download-filename?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ruoyi/common/utils/file/FileUtils.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java index 8d8f5a6a3..dd1bcc46f 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java @@ -210,6 +210,8 @@ public class FileUtils .append("utf-8''") .append(percentEncodedFileName); + response.addHeader("Access-Control-Allow-Origin", "*"); + response.addHeader("Access-Control-Expose-Headers", "Content-Disposition,download-filename"); response.setHeader("Content-disposition", contentDispositionValue.toString()); response.setHeader("download-filename", percentEncodedFileName); } From 8a7dcf8a80583eb5710a336c89be63541c3054f0 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 25 Oct 2021 10:26:00 +0800 Subject: [PATCH 008/110] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=94=99=E5=88=AB?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/common/annotation/RepeatSubmit.java | 2 +- .../java/com/ruoyi/framework/aspectj/RateLimiterAspect.java | 4 ++-- ruoyi-ui/src/layout/components/Settings/index.vue | 4 ++-- ruoyi-ui/src/views/index.vue | 2 +- ruoyi-ui/src/views/monitor/cache/index.vue | 2 +- ruoyi-ui/src/views/monitor/server/index.vue | 2 +- ruoyi-ui/src/views/system/role/index.vue | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java index 408300525..1e2774350 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java @@ -27,5 +27,5 @@ public @interface RepeatSubmit /** * 提示消息 */ - public String message() default "不允许重复提交,请稍后再试"; + public String message() default "不允许重复提交,请稍候再试"; } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java index 5020d000b..7b8ccf1d3 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java @@ -61,7 +61,7 @@ public class RateLimiterAspect Long number = redisTemplate.execute(limitScript, keys, count, time); if (StringUtils.isNull(number) || number.intValue() > count) { - throw new ServiceException("访问过于频繁,请稍后再试"); + throw new ServiceException("访问过于频繁,请稍候再试"); } log.info("限制请求'{}',当前请求'{}',缓存key'{}'", count, number.intValue(), key); } @@ -71,7 +71,7 @@ public class RateLimiterAspect } catch (Exception e) { - throw new RuntimeException("服务器限流异常,请稍后再试"); + throw new RuntimeException("服务器限流异常,请稍候再试"); } } diff --git a/ruoyi-ui/src/layout/components/Settings/index.vue b/ruoyi-ui/src/layout/components/Settings/index.vue index 4dff1d0c5..bd2f553cf 100644 --- a/ruoyi-ui/src/layout/components/Settings/index.vue +++ b/ruoyi-ui/src/layout/components/Settings/index.vue @@ -162,7 +162,7 @@ export default { this.sideTheme = val; }, saveSetting() { - this.$modal.loading("正在保存到本地,请稍后..."); + this.$modal.loading("正在保存到本地,请稍候..."); this.$cache.local.set( "layout-setting", `{ @@ -178,7 +178,7 @@ export default { setTimeout(this.$modal.closeLoading(), 1000) }, resetSetting() { - this.$modal.loading("正在清除设置缓存并刷新,请稍后..."); + this.$modal.loading("正在清除设置缓存并刷新,请稍候..."); this.$cache.local.remove("layout-setting") setTimeout("window.location.reload()", 1000) } diff --git a/ruoyi-ui/src/views/index.vue b/ruoyi-ui/src/views/index.vue index 00379e5aa..46811841b 100644 --- a/ruoyi-ui/src/views/index.vue +++ b/ruoyi-ui/src/views/index.vue @@ -590,7 +590,7 @@
  • 修复表格时间为空出现的异常
  • 添加Jackson日期反序列化时区配置
  • 调整根据用户权限加载菜单数据树形结构
  • -
  • 调整成功登陆不恢复按钮,防止多次点击
  • +
  • 调整成功登录不恢复按钮,防止多次点击
  • 修改用户个人资料同步缓存信息
  • 修复页面同时出现el-upload和Editor不显示处理
  • 修复在角色管理页修改菜单权限偶尔未选中问题
  • diff --git a/ruoyi-ui/src/views/monitor/cache/index.vue b/ruoyi-ui/src/views/monitor/cache/index.vue index 22501dc34..cafa28cfb 100644 --- a/ruoyi-ui/src/views/monitor/cache/index.vue +++ b/ruoyi-ui/src/views/monitor/cache/index.vue @@ -139,7 +139,7 @@ export default { }, // 打开加载层 openLoading() { - this.$modal.loading("正在加载缓存监控数据,请稍后!"); + this.$modal.loading("正在加载缓存监控数据,请稍候!"); }, }, }; diff --git a/ruoyi-ui/src/views/monitor/server/index.vue b/ruoyi-ui/src/views/monitor/server/index.vue index 503bf9b61..3eaaea0e1 100644 --- a/ruoyi-ui/src/views/monitor/server/index.vue +++ b/ruoyi-ui/src/views/monitor/server/index.vue @@ -196,7 +196,7 @@ export default { }, // 打开加载层 openLoading() { - this.$modal.loading("正在加载服务监控数据,请稍后!"); + this.$modal.loading("正在加载服务监控数据,请稍候!"); } } }; diff --git a/ruoyi-ui/src/views/system/role/index.vue b/ruoyi-ui/src/views/system/role/index.vue index 6e5855863..5110834d4 100644 --- a/ruoyi-ui/src/views/system/role/index.vue +++ b/ruoyi-ui/src/views/system/role/index.vue @@ -200,7 +200,7 @@ ref="menu" node-key="id" :check-strictly="!form.menuCheckStrictly" - empty-text="加载中,请稍后" + empty-text="加载中,请稍候" :props="defaultProps" > @@ -245,7 +245,7 @@ ref="dept" node-key="id" :check-strictly="!form.deptCheckStrictly" - empty-text="加载中,请稍后" + empty-text="加载中,请稍候" :props="defaultProps" > From 790aa0d24bee0036d9a697a18c130d531649213b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=AA=E4=B8=9B?= <8461269+ouwei2020@user.noreply.gitee.com> Date: Tue, 26 Oct 2021 01:42:12 +0000 Subject: [PATCH 009/110] =?UTF-8?q?update=20ruoyi-common/src/main/java/com?= =?UTF-8?q?/ruoyi/common/core/redis/RedisCache.java.=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=88=A0=E9=99=A4Hash=E4=B8=AD=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/common/core/redis/RedisCache.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java index 238753359..3246b7731 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java @@ -209,6 +209,18 @@ public class RedisCache return opsForHash.get(key, hKey); } + /** + * 删除Hash中的数据 + * + * @param key + * @param mapkey + */ + public void delCacheMapValue(final String key, final String hkey) + { + HashOperations hashOperations = redisTemplate.opsForHash(); + hashOperations.delete(key, hkey); + } + /** * 获取多个Hash中的数据 * From 0628dc9b2f175602e9d4cc921986318d331abc23 Mon Sep 17 00:00:00 2001 From: Remenber_Ray <343509740@qq.com> Date: Tue, 26 Oct 2021 08:02:48 +0000 Subject: [PATCH 010/110] update ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java. --- .../java/com/ruoyi/system/service/impl/SysUserServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java index b3febada9..7e8443c0f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java @@ -179,7 +179,7 @@ public class SysUserServiceImpl implements ISysUserService } /** - * 校验用户名称是否唯一 + * 校验手机号码是否唯一 * * @param user 用户信息 * @return From b6596d021b6216bd7750614e5588b319b4a5ce83 Mon Sep 17 00:00:00 2001 From: Ricky Date: Tue, 26 Oct 2021 17:22:20 +0800 Subject: [PATCH 011/110] =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E9=AA=8C=E8=AF=81=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-common/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 486d39f8c..eb84d30ce 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -43,8 +43,8 @@ - javax.validation - validation-api + org.springframework.boot + spring-boot-starter-validation From 839f631d6ba36b1e2c5cbfcd7d414f62d3afd840 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 27 Oct 2021 16:22:57 +0800 Subject: [PATCH 012/110] =?UTF-8?q?=E6=B7=BB=E5=8A=A0Jaxb=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=EF=BC=8C=E9=98=B2=E6=AD=A2jdk8=E4=BB=A5=E4=B8=8A?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E7=9A=84=E5=85=BC=E5=AE=B9=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-common/pom.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index eb84d30ce..278434bbe 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -89,12 +89,18 @@ snakeyaml - + io.jsonwebtoken jjwt + + + javax.xml.bind + jaxb-api + + org.springframework.boot From 2eb55528ec9e736f9754c86d5984f5dc8ea819d8 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 27 Oct 2021 16:23:35 +0800 Subject: [PATCH 013/110] =?UTF-8?q?=E5=8D=87=E7=BA=A7spring-boot=E5=88=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=AC2.5.6?= 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 6feb0ee79..2f3dd728d 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,7 @@ org.springframework.boot spring-boot-dependencies - 2.5.5 + 2.5.6 pom import From 13c770b6beedaee905d99d44bcd5c3378eeda0da Mon Sep 17 00:00:00 2001 From: Awen <39176130+yu1183688986@users.noreply.github.com> Date: Wed, 27 Oct 2021 19:03:29 +0800 Subject: [PATCH 014/110] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E5=B8=83=E5=B0=94=E5=88=A4=E6=96=AD=E8=AF=AD=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/common/utils/html/HTMLFilter.java | 2 +- .../src/main/java/com/ruoyi/common/utils/uuid/UUID.java | 8 ++++---- .../com/ruoyi/system/service/impl/SysDeptServiceImpl.java | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java index 415acbab2..d3b211a48 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java @@ -332,7 +332,7 @@ public final class HTMLFilter final String name = m.group(1).toLowerCase(); if (allowed(name)) { - if (false == inArray(name, vSelfClosingTags)) + if (!inArray(name, vSelfClosingTags)) { if (vTagCounts.containsKey(name)) { diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/UUID.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/UUID.java index eef72ee0b..c0c18af01 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/UUID.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/UUID.java @@ -343,25 +343,25 @@ public final class UUID implements java.io.Serializable, Comparable final StringBuilder builder = new StringBuilder(isSimple ? 32 : 36); // time_low builder.append(digits(mostSigBits >> 32, 8)); - if (false == isSimple) + if (!isSimple) { builder.append('-'); } // time_mid builder.append(digits(mostSigBits >> 16, 4)); - if (false == isSimple) + if (!isSimple) { builder.append('-'); } // time_high_and_version builder.append(digits(mostSigBits, 4)); - if (false == isSimple) + if (!isSimple) { builder.append('-'); } // variant_and_sequence builder.append(digits(leastSigBits >> 48, 4)); - if (false == isSimple) + if (!isSimple) { builder.append('-'); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index a2c3b5b1e..9bf8fe0e1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -140,7 +140,7 @@ public class SysDeptServiceImpl implements ISysDeptService public boolean hasChildByDeptId(Long deptId) { int result = deptMapper.hasChildByDeptId(deptId); - return result > 0 ? true : false; + return result > 0; } /** @@ -153,7 +153,7 @@ public class SysDeptServiceImpl implements ISysDeptService public boolean checkDeptExistUser(Long deptId) { int result = deptMapper.checkDeptExistUser(deptId); - return result > 0 ? true : false; + return result > 0; } /** @@ -325,6 +325,6 @@ public class SysDeptServiceImpl implements ISysDeptService */ private boolean hasChild(List list, SysDept t) { - return getChildList(list, t).size() > 0 ? true : false; + return getChildList(list, t).size() > 0; } } From 3ae5ec92a530e5f14720a8b7d490959430399b11 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 1 Nov 2021 13:29:27 +0800 Subject: [PATCH 015/110] =?UTF-8?q?=E7=99=BB=E5=BD=95/=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E8=AF=B7=E6=B1=82headers=E4=B8=8D=E8=AE=BE=E7=BD=AEto?= =?UTF-8?q?ken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/api/login.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ruoyi-ui/src/api/login.js b/ruoyi-ui/src/api/login.js index 224561606..26742e79c 100644 --- a/ruoyi-ui/src/api/login.js +++ b/ruoyi-ui/src/api/login.js @@ -10,6 +10,9 @@ export function login(username, password, code, uuid) { } return request({ url: '/login', + headers: { + isToken: false + }, method: 'post', data: data }) @@ -47,6 +50,9 @@ export function logout() { export function getCodeImg() { return request({ url: '/captchaImage', + headers: { + isToken: false + }, method: 'get', timeout: 20000 }) From 181f62c15ead24c5e56b77dde3bbf443430691bf Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 1 Nov 2021 14:40:00 +0800 Subject: [PATCH 016/110] =?UTF-8?q?=E5=9B=9E=E6=98=BE=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E9=94=AE=E5=80=BC=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/utils/ruoyi.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruoyi-ui/src/utils/ruoyi.js b/ruoyi-ui/src/utils/ruoyi.js index 63bd379b7..440bf4cd8 100644 --- a/ruoyi-ui/src/utils/ruoyi.js +++ b/ruoyi-ui/src/utils/ruoyi.js @@ -85,8 +85,8 @@ export function selectDictLabels(datas, value, separator) { var temp = value.split(currentSeparator); Object.keys(value.split(currentSeparator)).some((val) => { Object.keys(datas).some((key) => { - if (datas[key].dictValue == ('' + temp[val])) { - actions.push(datas[key].dictLabel + currentSeparator); + if (datas[key].value == ('' + temp[val])) { + actions.push(datas[key].label + currentSeparator); } }) }) From bd09e5b11ccb425d2b280c96b98dc110b1bb2c59 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 1 Nov 2021 15:02:47 +0800 Subject: [PATCH 017/110] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E6=97=A0=E6=B3=95=E8=A2=AB=E5=8F=8D=E8=BD=AC=E4=B9=89?= =?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/common/utils/html/EscapeUtil.java | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java index 65fd7920f..dda96c32f 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java @@ -69,26 +69,37 @@ public class EscapeUtil */ private static String encode(String text) { - int len; - if ((text == null) || ((len = text.length()) == 0)) + if (StringUtils.isEmpty(text)) { return StringUtils.EMPTY; } - StringBuilder buffer = new StringBuilder(len + (len >> 2)); + + final StringBuilder tmp = new StringBuilder(text.length() * 6); char c; - for (int i = 0; i < len; i++) + for (int i = 0; i < text.length(); i++) { c = text.charAt(i); - if (c < 64) + if (c < 256) { - buffer.append(TEXT[c]); + tmp.append("%"); + if (c < 16) + { + tmp.append("0"); + } + tmp.append(Integer.toString(c, 16)); } else { - buffer.append(c); + tmp.append("%u"); + if (c <= 0xfff) + { + // issue#I49JU8@Gitee + tmp.append("0"); + } + tmp.append(Integer.toString(c, 16)); } } - return buffer.toString(); + return tmp.toString(); } /** @@ -145,11 +156,12 @@ public class EscapeUtil public static void main(String[] args) { String html = ""; + String escape = EscapeUtil.escape(html); // String html = "ipt>alert(\"XSS\")ipt>"; // String html = "<123"; // String html = "123>"; - System.out.println(EscapeUtil.clean(html)); - System.out.println(EscapeUtil.escape(html)); - System.out.println(EscapeUtil.unescape(html)); + System.out.println("clean: " + EscapeUtil.clean(html)); + System.out.println("escape: " + escape); + System.out.println("unescape: " + EscapeUtil.unescape(escape)); } } From cc4c52c998f5ffd6adc63d62d870ce76ffa9ae61 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 1 Nov 2021 15:03:06 +0800 Subject: [PATCH 018/110] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=B1=8F=E8=94=BD?= =?UTF-8?q?=E8=BF=9D=E8=A7=84=E5=AD=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/common/constant/Constants.java | 8 +++++++- .../com/ruoyi/quartz/controller/SysJobController.java | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java index 9f55771bf..9e770c812 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java @@ -148,4 +148,10 @@ public class Constants * LDAP 远程方法调用 */ public static final String LOOKUP_LDAP = "ldap://"; -} + + /** + * 定时任务违规的字符 + */ + public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml", + "org.springframework.jndi" }; +} \ No newline at end of file diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java index c9616c2f6..2f3ddab6f 100644 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java @@ -96,6 +96,10 @@ public class SysJobController extends BaseController { return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'http(s)//'调用"); } + else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), Constants.JOB_ERROR_STR)) + { + return error("新增任务'" + job.getJobName() + "'失败,目标字符串存在违规"); + } job.setCreateBy(getUsername()); return toAjax(jobService.insertJob(job)); } @@ -124,6 +128,10 @@ public class SysJobController extends BaseController { return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'http(s)//'调用"); } + else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), Constants.JOB_ERROR_STR)) + { + return error("修改任务'" + job.getJobName() + "'失败,目标字符串存在违规"); + } job.setUpdateBy(getUsername()); return toAjax(jobService.updateJob(job)); } From bbbe83b737bb39804967a23502cbf9af135db164 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 2 Nov 2021 14:40:21 +0800 Subject: [PATCH 019/110] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E7=BE=A4?= =?UTF-8?q?=E5=8F=B7=EF=BC=9A101539465?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- ruoyi-ui/src/views/index.vue | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f1ec311a8..0c10287a4 100644 --- a/README.md +++ b/README.md @@ -82,4 +82,4 @@ ## 若依前后端分离交流群 -QQ群: [![加入QQ群](https://img.shields.io/badge/已满-937441-blue.svg)](https://jq.qq.com/?_wv=1027&k=5bVB1og) [![加入QQ群](https://img.shields.io/badge/已满-887144332-blue.svg)](https://jq.qq.com/?_wv=1027&k=5eiA4DH) [![加入QQ群](https://img.shields.io/badge/已满-180251782-blue.svg)](https://jq.qq.com/?_wv=1027&k=5AxMKlC) [![加入QQ群](https://img.shields.io/badge/已满-104180207-blue.svg)](https://jq.qq.com/?_wv=1027&k=51G72yr) [![加入QQ群](https://img.shields.io/badge/已满-186866453-blue.svg)](https://jq.qq.com/?_wv=1027&k=VvjN2nvu) [![加入QQ群](https://img.shields.io/badge/已满-201396349-blue.svg)](https://jq.qq.com/?_wv=1027&k=5vYAqA05) [![加入QQ群](https://img.shields.io/badge/101456076-blue.svg)](https://jq.qq.com/?_wv=1027&k=kOIINEb5) 点击按钮入群。 \ No newline at end of file +QQ群: [![加入QQ群](https://img.shields.io/badge/已满-937441-blue.svg)](https://jq.qq.com/?_wv=1027&k=5bVB1og) [![加入QQ群](https://img.shields.io/badge/已满-887144332-blue.svg)](https://jq.qq.com/?_wv=1027&k=5eiA4DH) [![加入QQ群](https://img.shields.io/badge/已满-180251782-blue.svg)](https://jq.qq.com/?_wv=1027&k=5AxMKlC) [![加入QQ群](https://img.shields.io/badge/已满-104180207-blue.svg)](https://jq.qq.com/?_wv=1027&k=51G72yr) [![加入QQ群](https://img.shields.io/badge/已满-186866453-blue.svg)](https://jq.qq.com/?_wv=1027&k=VvjN2nvu) [![加入QQ群](https://img.shields.io/badge/已满-201396349-blue.svg)](https://jq.qq.com/?_wv=1027&k=5vYAqA05) [![加入QQ群](https://img.shields.io/badge/已满-101456076-blue.svg)](https://jq.qq.com/?_wv=1027&k=kOIINEb5) [![加入QQ群](https://img.shields.io/badge/101539465-blue.svg)](https://jq.qq.com/?_wv=1027&k=UKtX5jhs) 点击按钮入群。 \ No newline at end of file diff --git a/ruoyi-ui/src/views/index.vue b/ruoyi-ui/src/views/index.vue index 46811841b..4609c136e 100644 --- a/ruoyi-ui/src/views/index.vue +++ b/ruoyi-ui/src/views/index.vue @@ -120,9 +120,9 @@

    QQ群:满937441 满887144332 满180251782 满104180207 - 满186866453 满201396349 - - 101456076满186866453 满201396349 满101456076 + + 101539465

    From d185d4e4ccaba6480bedf7a497cb7d5b633576cb Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 10 Nov 2021 11:13:27 +0800 Subject: [PATCH 020/110] =?UTF-8?q?=E5=A2=9E=E5=8A=A0sendGet=E6=97=A0?= =?UTF-8?q?=E5=8F=82=E8=AF=B7=E6=B1=82=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/common/utils/http/HttpUtils.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java index c920f5b12..f57baf0fc 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java @@ -30,6 +30,17 @@ public class HttpUtils { private static final Logger log = LoggerFactory.getLogger(HttpUtils.class); + /** + * 向指定 URL 发送GET方法的请求 + * + * @param url 发送请求的 URL + * @return 所代表远程资源的响应结果 + */ + public static String sendGet(String url) + { + return sendGet(url, StringUtils.EMPTY); + } + /** * 向指定 URL 发送GET方法的请求 * From 4e817a11092343ff0bac1e80cbbb486e189075fe Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 10 Nov 2021 11:14:50 +0800 Subject: [PATCH 021/110] =?UTF-8?q?=E5=8D=87=E7=BA=A7axios=E5=88=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=AC0.24.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index 034e0642d..fd8630ddc 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -37,7 +37,7 @@ }, "dependencies": { "@riophae/vue-treeselect": "0.4.0", - "axios": "0.21.0", + "axios": "0.24.0", "clipboard": "2.0.6", "core-js": "3.8.1", "echarts": "4.9.0", From b00171366ff27099133675f8bd66464b5e037867 Mon Sep 17 00:00:00 2001 From: XTvLi <948038320@qq.com> Date: Wed, 10 Nov 2021 18:17:43 +0800 Subject: [PATCH 022/110] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=86=85=E5=AE=B9,=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E4=B8=B4=E6=97=B6=E8=B0=83=E7=94=A8=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/common/CaptchaController.java | 7 ++----- .../java/com/ruoyi/common/config/RuoYiConfig.java | 11 +++++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java index 649fd115e..955c78436 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java @@ -6,8 +6,8 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Resource; import javax.imageio.ImageIO; import javax.servlet.http.HttpServletResponse; +import com.ruoyi.common.config.RuoYiConfig; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.util.FastByteArrayOutputStream; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @@ -36,10 +36,6 @@ public class CaptchaController @Autowired private RedisCache redisCache; - // 验证码类型 - @Value("${ruoyi.captchaType}") - private String captchaType; - @Autowired private ISysConfigService configService; /** @@ -64,6 +60,7 @@ public class CaptchaController BufferedImage image = null; // 生成验证码 + String captchaType = RuoYiConfig.getCaptchaType(); if ("math".equals(captchaType)) { String capText = captchaProducerMath.createText(); diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java b/ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java index 843b91912..84c0029db 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java @@ -30,6 +30,9 @@ public class RuoYiConfig /** 获取地址开关 */ private static boolean addressEnabled; + /** 验证码类型 */ + private static String captchaType; + public String getName() { return name; @@ -90,6 +93,14 @@ public class RuoYiConfig RuoYiConfig.addressEnabled = addressEnabled; } + public static String getCaptchaType() { + return captchaType; + } + + public void setCaptchaType(String captchaType) { + RuoYiConfig.captchaType = captchaType; + } + /** * 获取导入上传路径 */ From cb9c0e79ebadd5d219f60a2830e36e50868354cb Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 16 Nov 2021 14:15:17 +0800 Subject: [PATCH 023/110] =?UTF-8?q?=E5=8D=87=E7=BA=A7core-js=E5=88=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=AC3.19.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index fd8630ddc..45f5508e6 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -39,7 +39,7 @@ "@riophae/vue-treeselect": "0.4.0", "axios": "0.24.0", "clipboard": "2.0.6", - "core-js": "3.8.1", + "core-js": "3.19.1", "echarts": "4.9.0", "element-ui": "2.15.6", "file-saver": "2.0.5", From 2ab96587ef8a2fab5e22ed786ff11953d2f2b0e2 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 16 Nov 2021 16:05:15 +0800 Subject: [PATCH 024/110] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=BF=BD=E7=95=A5=E5=8F=8C=E5=BC=95=E5=8F=B7=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E9=80=97=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ruoyi/quartz/util/JobInvokeUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/JobInvokeUtil.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/JobInvokeUtil.java index 5519c672f..4cde0ec44 100644 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/JobInvokeUtil.java +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/JobInvokeUtil.java @@ -110,7 +110,7 @@ public class JobInvokeUtil { return null; } - String[] methodParams = methodStr.split(","); + String[] methodParams = methodStr.split(",(?=(?:[^\']*\"[^\']*\')*[^\']*$)"); List classs = new LinkedList<>(); for (int i = 0; i < methodParams.length; i++) { From cedd2d1daf444c0f74ca2a7844e769d524877279 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 17 Nov 2021 11:57:17 +0800 Subject: [PATCH 025/110] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitor/SysLogininforController.java | 8 ++- .../monitor/SysOperlogController.java | 8 ++- .../system/SysConfigController.java | 9 ++- .../system/SysDictDataController.java | 7 +- .../system/SysDictTypeController.java | 7 +- .../controller/system/SysPostController.java | 7 +- .../controller/system/SysRoleController.java | 7 +- .../controller/system/SysUserController.java | 13 ++-- .../com/ruoyi/common/utils/poi/ExcelUtil.java | 17 +++-- .../main/resources/vm/java/controller.java.vm | 7 +- .../src/main/resources/vm/vue/index.vue.vm | 16 ++--- .../quartz/controller/SysJobController.java | 7 +- .../controller/SysJobLogController.java | 8 ++- ruoyi-ui/src/api/monitor/job.js | 9 --- ruoyi-ui/src/api/monitor/jobLog.js | 9 --- ruoyi-ui/src/api/monitor/logininfor.js | 9 --- ruoyi-ui/src/api/monitor/operlog.js | 9 --- ruoyi-ui/src/api/system/config.js | 9 --- ruoyi-ui/src/api/system/dict/data.js | 9 --- ruoyi-ui/src/api/system/dict/type.js | 9 --- ruoyi-ui/src/api/system/post.js | 9 --- ruoyi-ui/src/api/system/role.js | 9 --- ruoyi-ui/src/api/system/user.js | 17 ----- ruoyi-ui/src/main.js | 2 + ruoyi-ui/src/plugins/download.js | 18 ++--- ruoyi-ui/src/utils/request.js | 68 ++++++++++++------- ruoyi-ui/src/utils/ruoyi.js | 37 ++++++++++ ruoyi-ui/src/views/monitor/job/index.vue | 16 ++--- ruoyi-ui/src/views/monitor/job/log.vue | 16 ++--- .../src/views/monitor/logininfor/index.vue | 16 ++--- ruoyi-ui/src/views/monitor/operlog/index.vue | 16 ++--- ruoyi-ui/src/views/system/config/index.vue | 16 ++--- ruoyi-ui/src/views/system/dict/data.vue | 16 ++--- ruoyi-ui/src/views/system/dict/index.vue | 16 ++--- ruoyi-ui/src/views/system/post/index.vue | 16 ++--- ruoyi-ui/src/views/system/role/index.vue | 16 ++--- ruoyi-ui/src/views/system/user/index.vue | 22 ++---- 37 files changed, 192 insertions(+), 318 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java index 14f57fdaf..5bd40baed 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java @@ -1,11 +1,13 @@ package com.ruoyi.web.controller.monitor; import java.util.List; +import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Log; @@ -40,12 +42,12 @@ public class SysLogininforController extends BaseController @Log(title = "登录日志", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')") - @GetMapping("/export") - public AjaxResult export(SysLogininfor logininfor) + @PostMapping("/export") + public void export(HttpServletResponse response, SysLogininfor logininfor) { List list = logininforService.selectLogininforList(logininfor); ExcelUtil util = new ExcelUtil(SysLogininfor.class); - return util.exportExcel(list, "登录日志"); + util.exportExcel(response, list, "登录日志"); } @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java index 75bf12682..4ce126a54 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java @@ -1,11 +1,13 @@ package com.ruoyi.web.controller.monitor; import java.util.List; +import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Log; @@ -40,12 +42,12 @@ public class SysOperlogController extends BaseController @Log(title = "操作日志", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('monitor:operlog:export')") - @GetMapping("/export") - public AjaxResult export(SysOperLog operLog) + @PostMapping("/export") + public void export(HttpServletResponse response, SysOperLog operLog) { List list = operLogService.selectOperLogList(operLog); ExcelUtil util = new ExcelUtil(SysOperLog.class); - return util.exportExcel(list, "操作日志"); + util.exportExcel(response, list, "操作日志"); } @Log(title = "操作日志", businessType = BusinessType.DELETE) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java index dc2532fbc..04f71629a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java @@ -1,6 +1,7 @@ package com.ruoyi.web.controller.system; import java.util.List; +import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -13,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.annotation.RepeatSubmit; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; @@ -49,12 +49,12 @@ public class SysConfigController extends BaseController @Log(title = "参数管理", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('system:config:export')") - @GetMapping("/export") - public AjaxResult export(SysConfig config) + @PostMapping("/export") + public void export(HttpServletResponse response, SysConfig config) { List list = configService.selectConfigList(config); ExcelUtil util = new ExcelUtil(SysConfig.class); - return util.exportExcel(list, "参数数据"); + util.exportExcel(response, list, "参数数据"); } /** @@ -82,7 +82,6 @@ public class SysConfigController extends BaseController @PreAuthorize("@ss.hasPermi('system:config:add')") @Log(title = "参数管理", businessType = BusinessType.INSERT) @PostMapping - @RepeatSubmit public AjaxResult add(@Validated @RequestBody SysConfig config) { if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java index b9e3dc3b1..eea89fd0d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java @@ -2,6 +2,7 @@ package com.ruoyi.web.controller.system; import java.util.ArrayList; import java.util.List; +import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -50,12 +51,12 @@ public class SysDictDataController extends BaseController @Log(title = "字典数据", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('system:dict:export')") - @GetMapping("/export") - public AjaxResult export(SysDictData dictData) + @PostMapping("/export") + public void export(HttpServletResponse response, SysDictData dictData) { List list = dictDataService.selectDictDataList(dictData); ExcelUtil util = new ExcelUtil(SysDictData.class); - return util.exportExcel(list, "字典数据"); + util.exportExcel(response, list, "字典数据"); } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java index acad00e26..0dd3474cf 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java @@ -1,6 +1,7 @@ package com.ruoyi.web.controller.system; import java.util.List; +import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -45,12 +46,12 @@ public class SysDictTypeController extends BaseController @Log(title = "字典类型", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('system:dict:export')") - @GetMapping("/export") - public AjaxResult export(SysDictType dictType) + @PostMapping("/export") + public void export(HttpServletResponse response, SysDictType dictType) { List list = dictTypeService.selectDictTypeList(dictType); ExcelUtil util = new ExcelUtil(SysDictType.class); - return util.exportExcel(list, "字典类型"); + util.exportExcel(response, list, "字典类型"); } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java index 30a87616c..1a2b408ed 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java @@ -1,6 +1,7 @@ package com.ruoyi.web.controller.system; import java.util.List; +import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -48,12 +49,12 @@ public class SysPostController extends BaseController @Log(title = "岗位管理", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('system:post:export')") - @GetMapping("/export") - public AjaxResult export(SysPost post) + @PostMapping("/export") + public void export(HttpServletResponse response, SysPost post) { List list = postService.selectPostList(post); ExcelUtil util = new ExcelUtil(SysPost.class); - return util.exportExcel(list, "岗位数据"); + util.exportExcel(response, list, "岗位数据"); } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java index d73749086..d70fa8158 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java @@ -1,6 +1,7 @@ package com.ruoyi.web.controller.system; import java.util.List; +import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -61,12 +62,12 @@ public class SysRoleController extends BaseController @Log(title = "角色管理", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('system:role:export')") - @GetMapping("/export") - public AjaxResult export(SysRole role) + @PostMapping("/export") + public void export(HttpServletResponse response, SysRole role) { List list = roleService.selectRoleList(role); ExcelUtil util = new ExcelUtil(SysRole.class); - return util.exportExcel(list, "角色数据"); + util.exportExcel(response, list, "角色数据"); } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java index 6cfbfb8d7..9aacc3be0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java @@ -2,6 +2,7 @@ package com.ruoyi.web.controller.system; import java.util.List; import java.util.stream.Collectors; +import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang3.ArrayUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; @@ -62,12 +63,12 @@ public class SysUserController extends BaseController @Log(title = "用户管理", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('system:user:export')") - @GetMapping("/export") - public AjaxResult export(SysUser user) + @PostMapping("/export") + public void export(HttpServletResponse response, SysUser user) { List list = userService.selectUserList(user); ExcelUtil util = new ExcelUtil(SysUser.class); - return util.exportExcel(list, "用户数据"); + util.exportExcel(response, list, "用户数据"); } @Log(title = "用户管理", businessType = BusinessType.IMPORT) @@ -82,11 +83,11 @@ public class SysUserController extends BaseController return AjaxResult.success(message); } - @GetMapping("/importTemplate") - public AjaxResult importTemplate() + @PostMapping("/importTemplate") + public void importTemplate(HttpServletResponse response) { ExcelUtil util = new ExcelUtil(SysUser.class); - return util.importTemplateExcel("用户数据"); + util.importTemplateExcel(response, "用户数据"); } /** diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java index 4169360a1..93a19e870 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java @@ -431,7 +431,7 @@ public class ExcelUtil * @return 结果 * @throws IOException */ - public void exportExcel(HttpServletResponse response, List list, String sheetName)throws IOException + public void exportExcel(HttpServletResponse response, List list, String sheetName) { exportExcel(response, list, sheetName, StringUtils.EMPTY); } @@ -446,12 +446,12 @@ public class ExcelUtil * @return 结果 * @throws IOException */ - public void exportExcel(HttpServletResponse response, List list, String sheetName, String title) throws IOException + public void exportExcel(HttpServletResponse response, List list, String sheetName, String title) { response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setCharacterEncoding("utf-8"); this.init(list, sheetName, title, Type.EXPORT); - exportExcel(response.getOutputStream()); + exportExcel(response); } /** @@ -484,7 +484,7 @@ public class ExcelUtil * @param sheetName 工作表的名称 * @return 结果 */ - public void importTemplateExcel(HttpServletResponse response, String sheetName) throws IOException + public void importTemplateExcel(HttpServletResponse response, String sheetName) { importTemplateExcel(response, sheetName, StringUtils.EMPTY); } @@ -496,12 +496,12 @@ public class ExcelUtil * @param title 标题 * @return 结果 */ - public void importTemplateExcel(HttpServletResponse response, String sheetName, String title) throws IOException + public void importTemplateExcel(HttpServletResponse response, String sheetName, String title) { response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setCharacterEncoding("utf-8"); this.init(null, sheetName, title, Type.IMPORT); - exportExcel(response.getOutputStream()); + exportExcel(response); } /** @@ -509,12 +509,12 @@ public class ExcelUtil * * @return 结果 */ - public void exportExcel(OutputStream out) + public void exportExcel(HttpServletResponse response) { try { writeSheet(); - wb.write(out); + wb.write(response.getOutputStream()); } catch (Exception e) { @@ -523,7 +523,6 @@ public class ExcelUtil finally { IOUtils.closeQuietly(wb); - IOUtils.closeQuietly(out); } } diff --git a/ruoyi-generator/src/main/resources/vm/java/controller.java.vm b/ruoyi-generator/src/main/resources/vm/java/controller.java.vm index 56ff5e66a..ab19cf51f 100644 --- a/ruoyi-generator/src/main/resources/vm/java/controller.java.vm +++ b/ruoyi-generator/src/main/resources/vm/java/controller.java.vm @@ -1,6 +1,7 @@ package ${packageName}.controller; import java.util.List; +import javax.servlet.http.HttpServletResponse; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -61,12 +62,12 @@ public class ${ClassName}Controller extends BaseController */ @PreAuthorize("@ss.hasPermi('${permissionPrefix}:export')") @Log(title = "${functionName}", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public AjaxResult export(${ClassName} ${className}) + @PostMapping("/export") + public void export(HttpServletResponse response, ${ClassName} ${className}) { List<${ClassName}> list = ${className}Service.select${ClassName}List(${className}); ExcelUtil<${ClassName}> util = new ExcelUtil<${ClassName}>(${ClassName}.class); - return util.exportExcel(list, "${functionName}数据"); + util.exportExcel(response, list, "${functionName}数据"); } /** diff --git a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm index 867225aba..729a9dafe 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm @@ -108,7 +108,6 @@ plain icon="el-icon-download" size="mini" - :loading="exportLoading" @click="handleExport" v-hasPermi="['${moduleName}:${businessName}:export']" >导出 @@ -313,7 +312,7 @@ From a2d3f987c04a2e5176a8686f1032f7f5bfee4af2 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 30 Nov 2021 11:15:17 +0800 Subject: [PATCH 046/110] =?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 --- .../controller/system/SysProfileController.java | 2 +- .../system/service/impl/SysMenuServiceImpl.java | 15 +++++++++++++-- ruoyi-ui/src/plugins/modal.js | 8 ++++++++ ruoyi-ui/src/views/monitor/online/index.vue | 2 +- ruoyi-ui/src/views/system/user/index.vue | 2 +- ruoyi-ui/src/views/tool/gen/basicInfoForm.vue | 3 +-- ruoyi-ui/src/views/tool/gen/editTable.vue | 1 + ruoyi-ui/src/views/tool/gen/genInfoForm.vue | 3 +-- 8 files changed, 27 insertions(+), 9 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java index d764651c8..be515fd61 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java @@ -72,7 +72,7 @@ public class SysProfileController extends BaseController && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) { return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); - } + } user.setUserId(sysUser.getUserId()); user.setPassword(null); if (userService.updateUserProfile(user) > 0) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java index af97f1492..d509da2b6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java @@ -179,7 +179,7 @@ public class SysMenuServiceImpl implements ISysMenuService router.setPath("/inner"); List childrenList = new ArrayList(); RouterVo children = new RouterVo(); - String routerPath = StringUtils.replaceEach(menu.getPath(), new String[] { Constants.HTTP, Constants.HTTPS }, new String[] { "", "" }); + String routerPath = innerLinkReplaceEach(menu.getPath()); children.setPath(routerPath); children.setComponent(UserConstants.INNER_LINK); children.setName(StringUtils.capitalize(routerPath)); @@ -358,7 +358,7 @@ public class SysMenuServiceImpl implements ISysMenuService // 内链打开外网方式 if (menu.getParentId().intValue() != 0 && isInnerLink(menu)) { - routerPath = StringUtils.replaceEach(routerPath, new String[] { Constants.HTTP, Constants.HTTPS }, new String[] { "", "" }); + routerPath = innerLinkReplaceEach(routerPath); } // 非外链并且是一级目录(类型为目录) if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType()) @@ -500,4 +500,15 @@ public class SysMenuServiceImpl implements ISysMenuService { return getChildList(list, t).size() > 0 ? true : false; } + + /** + * 内链域名特殊字符替换 + * + * @return + */ + public String innerLinkReplaceEach(String path) + { + return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS }, + new String[] { "", "" }); + } } diff --git a/ruoyi-ui/src/plugins/modal.js b/ruoyi-ui/src/plugins/modal.js index 7df61a890..503a16f46 100644 --- a/ruoyi-ui/src/plugins/modal.js +++ b/ruoyi-ui/src/plugins/modal.js @@ -59,6 +59,14 @@ export default { type: "warning", }) }, + // 提交内容 + prompt(content) { + return MessageBox.prompt(content, "系统提示", { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: "warning", + }) + }, // 打开遮罩层 loading(content) { loadingInstance = Loading.service({ diff --git a/ruoyi-ui/src/views/monitor/online/index.vue b/ruoyi-ui/src/views/monitor/online/index.vue index ab66827b8..fedf08038 100644 --- a/ruoyi-ui/src/views/monitor/online/index.vue +++ b/ruoyi-ui/src/views/monitor/online/index.vue @@ -111,7 +111,7 @@ export default { }, /** 强退按钮操作 */ handleForceLogout(row) { - this.$modal.confirm('是否确认强退名称为"' + row.userName + '"的数据项?').then(function() { + this.$modal.confirm('是否确认强退名称为"' + row.userName + '"的用户?').then(function() { return forceLogout(row.tokenId); }).then(() => { this.getList(); diff --git a/ruoyi-ui/src/views/system/user/index.vue b/ruoyi-ui/src/views/system/user/index.vue index 3525c9b3f..c538a6984 100644 --- a/ruoyi-ui/src/views/system/user/index.vue +++ b/ruoyi-ui/src/views/system/user/index.vue @@ -596,7 +596,7 @@ export default { cancelButtonText: "取消", closeOnClickModal: false, inputPattern: /^.{5,20}$/, - inputErrorMessage: "用户密码长度必须介于 5 和 20 之间", + inputErrorMessage: "用户密码长度必须介于 5 和 20 之间" }).then(({ value }) => { resetUserPwd(row.userId, value).then(response => { this.$modal.msgSuccess("修改成功,新密码是:" + value); diff --git a/ruoyi-ui/src/views/tool/gen/basicInfoForm.vue b/ruoyi-ui/src/views/tool/gen/basicInfoForm.vue index f3e87172b..75dc3bf3b 100644 --- a/ruoyi-ui/src/views/tool/gen/basicInfoForm.vue +++ b/ruoyi-ui/src/views/tool/gen/basicInfoForm.vue @@ -11,7 +11,6 @@ - @@ -30,9 +29,9 @@ + diff --git a/ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm new file mode 100644 index 000000000..6e7b41f1e --- /dev/null +++ b/ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm @@ -0,0 +1,567 @@ + + + diff --git a/ruoyi-generator/src/main/resources/vm/vue/v3/readme.txt b/ruoyi-generator/src/main/resources/vm/vue/v3/readme.txt new file mode 100644 index 000000000..99239bb53 --- /dev/null +++ b/ruoyi-generator/src/main/resources/vm/vue/v3/readme.txt @@ -0,0 +1 @@ +ʹõRuoYi-Vue3ǰˣôҪһ´Ŀ¼ģindex.vue.vmindex-tree.vue.vmļϼvueĿ¼ \ No newline at end of file From 6e14601c7cd8312a8dcb372b341ea05c7b965a23 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 16 Dec 2021 16:34:20 +0800 Subject: [PATCH 064/110] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=B7=AE=E5=BC=82=E5=AF=BC=E8=87=B4=E7=9A=84=E6=87=92=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/package.json | 1 + ruoyi-ui/src/router/index.js | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index 600e9ad12..6d33bdf57 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -65,6 +65,7 @@ "@vue/cli-plugin-eslint": "4.4.6", "@vue/cli-service": "4.4.6", "babel-eslint": "10.1.0", + "babel-plugin-dynamic-import-node": "2.3.3", "chalk": "4.1.0", "connect": "3.6.6", "eslint": "7.15.0", diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index ccf886f73..6510ff708 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -35,28 +35,28 @@ export const constantRoutes = [ children: [ { path: '/redirect/:path(.*)', - component: (resolve) => require(['@/views/redirect'], resolve) + component: () => import('@/views/redirect') } ] }, { path: '/login', - component: (resolve) => require(['@/views/login'], resolve), + component: () => import('@/views/login'), hidden: true }, { path: '/register', - component: (resolve) => require(['@/views/register'], resolve), + component: () => import('@/views/register'), hidden: true }, { path: '/404', - component: (resolve) => require(['@/views/error/404'], resolve), + component: () => import('@/views/error/404'), hidden: true }, { path: '/401', - component: (resolve) => require(['@/views/error/401'], resolve), + component: () => import('@/views/error/401'), hidden: true }, { @@ -66,7 +66,7 @@ export const constantRoutes = [ children: [ { path: 'index', - component: (resolve) => require(['@/views/index'], resolve), + component: () => import('@/views/index'), name: 'Index', meta: { title: '首页', icon: 'dashboard', affix: true } } @@ -80,7 +80,7 @@ export const constantRoutes = [ children: [ { path: 'profile', - component: (resolve) => require(['@/views/system/user/profile/index'], resolve), + component: () => import('@/views/system/user/profile/index'), name: 'Profile', meta: { title: '个人中心', icon: 'user' } } @@ -93,7 +93,7 @@ export const constantRoutes = [ children: [ { path: 'role/:userId(\\d+)', - component: (resolve) => require(['@/views/system/user/authRole'], resolve), + component: () => import('@/views/system/user/authRole'), name: 'AuthRole', meta: { title: '分配角色', activeMenu: '/system/user' } } @@ -106,7 +106,7 @@ export const constantRoutes = [ children: [ { path: 'user/:roleId(\\d+)', - component: (resolve) => require(['@/views/system/role/authUser'], resolve), + component: () => import('@/views/system/role/authUser'), name: 'AuthUser', meta: { title: '分配用户', activeMenu: '/system/role' } } @@ -119,7 +119,7 @@ export const constantRoutes = [ children: [ { path: 'index/:dictId(\\d+)', - component: (resolve) => require(['@/views/system/dict/data'], resolve), + component: () => import('@/views/system/dict/data'), name: 'Data', meta: { title: '字典数据', activeMenu: '/system/dict' } } @@ -132,7 +132,7 @@ export const constantRoutes = [ children: [ { path: 'index', - component: (resolve) => require(['@/views/monitor/job/log'], resolve), + component: () => import('@/views/monitor/job/log'), name: 'JobLog', meta: { title: '调度日志', activeMenu: '/monitor/job' } } @@ -145,7 +145,7 @@ export const constantRoutes = [ children: [ { path: 'index', - component: (resolve) => require(['@/views/tool/gen/editTable'], resolve), + component: () => import('@/views/tool/gen/editTable'), name: 'GenEdit', meta: { title: '修改生成配置', activeMenu: '/tool/gen' } } From 47b67331d4197023189482763d9a9f01d6ece32e Mon Sep 17 00:00:00 2001 From: 18297093310 <18297093310@163.com> Date: Fri, 17 Dec 2021 03:06:25 +0000 Subject: [PATCH 065/110] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=87=8D=E7=BD=AE?= =?UTF-8?q?=E8=A1=A8=E5=8D=95bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/system/menu/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-ui/src/views/system/menu/index.vue b/ruoyi-ui/src/views/system/menu/index.vue index d65773ad2..5c1f85a6f 100644 --- a/ruoyi-ui/src/views/system/menu/index.vue +++ b/ruoyi-ui/src/views/system/menu/index.vue @@ -128,7 +128,7 @@ - + Date: Fri, 17 Dec 2021 11:36:15 +0800 Subject: [PATCH 066/110] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=93=E5=8C=85?= =?UTF-8?q?=E5=90=8E=E5=AD=97=E4=BD=93=E5=9B=BE=E6=A0=87=E5=81=B6=E7=8E=B0?= =?UTF-8?q?=E7=9A=84=E4=B9=B1=E7=A0=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/vue.config.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ruoyi-ui/vue.config.js b/ruoyi-ui/vue.config.js index 76707460a..36cd2025e 100644 --- a/ruoyi-ui/vue.config.js +++ b/ruoyi-ui/vue.config.js @@ -42,6 +42,13 @@ module.exports = { }, disableHostCheck: true }, + css: { + loaderOptions: { + sass: { + sassOptions: { outputStyle: "expanded" } + } + } + }, configureWebpack: { name: name, resolve: { From 7492dcc9e6bf3e5dca48a14cf775c6c693bf32e5 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 18 Dec 2021 12:22:41 +0800 Subject: [PATCH 067/110] =?UTF-8?q?=E8=AF=B7=E6=B1=82=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E8=AE=BE=E7=BD=AE=E6=88=90=E9=80=9A=E7=94=A8?= =?UTF-8?q?=E6=96=B9=E4=BE=BF=E7=81=B5=E6=B4=BB=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/controller/BaseController.java | 11 ++----- .../com/ruoyi/common/utils/PageUtils.java | 29 +++++++++++++++++++ 2 files changed, 31 insertions(+), 9 deletions(-) create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java index 5b450cb87..2aeaf9bae 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java @@ -16,6 +16,7 @@ import com.ruoyi.common.core.page.PageDomain; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableSupport; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.PageUtils; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.sql.SqlUtil; @@ -51,15 +52,7 @@ public class BaseController */ protected void startPage() { - PageDomain pageDomain = TableSupport.buildPageRequest(); - Integer pageNum = pageDomain.getPageNum(); - Integer pageSize = pageDomain.getPageSize(); - if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) - { - String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); - Boolean reasonable = pageDomain.getReasonable(); - PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable); - } + PageUtils.startPage(); } /** diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java new file mode 100644 index 000000000..62a763277 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java @@ -0,0 +1,29 @@ +package com.ruoyi.common.utils; + +import com.github.pagehelper.PageHelper; +import com.ruoyi.common.core.page.PageDomain; +import com.ruoyi.common.core.page.TableSupport; +import com.ruoyi.common.utils.sql.SqlUtil; + +/** + * 分页工具类 + * + * @author ruoyi + */ +public class PageUtils extends PageHelper +{ + /** + * 设置请求分页数据 + */ + public static void startPage() + { + PageDomain pageDomain = TableSupport.buildPageRequest(); + Integer pageNum = pageDomain.getPageNum(); + Integer pageSize = pageDomain.getPageSize(); + if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) + { + String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); + PageHelper.startPage(pageNum, pageSize, orderBy); + } + } +} From 903b5aebca7951da979d703604c7f54159498157 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 18 Dec 2021 12:23:59 +0800 Subject: [PATCH 068/110] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/ImagePreview/index.vue | 67 +++++++++++++++++++ ruoyi-ui/src/main.js | 3 + 2 files changed, 70 insertions(+) create mode 100644 ruoyi-ui/src/components/ImagePreview/index.vue diff --git a/ruoyi-ui/src/components/ImagePreview/index.vue b/ruoyi-ui/src/components/ImagePreview/index.vue new file mode 100644 index 000000000..44e27aac2 --- /dev/null +++ b/ruoyi-ui/src/components/ImagePreview/index.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/ruoyi-ui/src/main.js b/ruoyi-ui/src/main.js index 729467aee..ebd94b9d8 100644 --- a/ruoyi-ui/src/main.js +++ b/ruoyi-ui/src/main.js @@ -29,6 +29,8 @@ import Editor from "@/components/Editor" import FileUpload from "@/components/FileUpload" // 图片上传组件 import ImageUpload from "@/components/ImageUpload" +// 图片预览组件 +import ImagePreview from "@/components/ImagePreview" // 字典标签组件 import DictTag from '@/components/DictTag' // 头部标签组件 @@ -54,6 +56,7 @@ Vue.component('RightToolbar', RightToolbar) Vue.component('Editor', Editor) Vue.component('FileUpload', FileUpload) Vue.component('ImageUpload', ImageUpload) +Vue.component('ImagePreview', ImagePreview) Vue.use(directive) Vue.use(plugins) From e5647793ce650582787622aa8a9828356911dcc6 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 18 Dec 2021 16:48:31 +0800 Subject: [PATCH 069/110] =?UTF-8?q?=E8=B7=AF=E7=94=B1=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=8D=95=E7=8B=AC=E9=85=8D=E7=BD=AE=E8=8F=9C=E5=8D=95=E6=88=96?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/router/index.js | 13 ++++++++++++- ruoyi-ui/src/store/modules/permission.js | 22 +++++++++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index 6510ff708..e4ccf19a6 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -17,6 +17,8 @@ import Layout from '@/layout' * redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击 * name:'router-name' // 设定路由的名字,一定要填写不然使用时会出现各种问题 * query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数 + * roles: ['admin', 'common'] // 访问路由的角色权限 + * permissions: ['a:a:a', 'b:b:b'] // 访问路由的菜单权限 * meta : { noCache: true // 如果设置为true,则不会被 缓存(默认 false) title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字 @@ -85,11 +87,16 @@ export const constantRoutes = [ meta: { title: '个人中心', icon: 'user' } } ] - }, + } +] + +// 动态路由,基于用户权限动态去加载 +export const dynamicRoutes = [ { path: '/system/user-auth', component: Layout, hidden: true, + permissions: ['system:user:edit'], children: [ { path: 'role/:userId(\\d+)', @@ -103,6 +110,7 @@ export const constantRoutes = [ path: '/system/role-auth', component: Layout, hidden: true, + permissions: ['system:role:edit'], children: [ { path: 'user/:roleId(\\d+)', @@ -116,6 +124,7 @@ export const constantRoutes = [ path: '/system/dict-data', component: Layout, hidden: true, + permissions: ['system:dict:list'], children: [ { path: 'index/:dictId(\\d+)', @@ -129,6 +138,7 @@ export const constantRoutes = [ path: '/monitor/job-log', component: Layout, hidden: true, + permissions: ['monitor:job:list'], children: [ { path: 'index', @@ -142,6 +152,7 @@ export const constantRoutes = [ path: '/tool/gen-edit', component: Layout, hidden: true, + permissions: ['tool:gen:edit'], children: [ { path: 'index', diff --git a/ruoyi-ui/src/store/modules/permission.js b/ruoyi-ui/src/store/modules/permission.js index 2c2120a8f..8c3c33909 100644 --- a/ruoyi-ui/src/store/modules/permission.js +++ b/ruoyi-ui/src/store/modules/permission.js @@ -1,4 +1,5 @@ -import { constantRoutes } from '@/router' +import auth from '@/plugins/auth' +import router, { constantRoutes, dynamicRoutes } from '@/router' import { getRouters } from '@/api/menu' import Layout from '@/layout/index' import ParentView from '@/components/ParentView' @@ -42,7 +43,9 @@ const permission = { const rdata = JSON.parse(JSON.stringify(res.data)) const sidebarRoutes = filterAsyncRouter(sdata) const rewriteRoutes = filterAsyncRouter(rdata, false, true) + const asyncRoutes = filterDynamicRoutes(dynamicRoutes); rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true }) + router.addRoutes(asyncRoutes); commit('SET_ROUTES', rewriteRoutes) commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes)) commit('SET_DEFAULT_ROUTES', sidebarRoutes) @@ -106,6 +109,23 @@ function filterChildren(childrenMap, lastRouter = false) { return children } +// 动态路由遍历,验证是否具备权限 +export function filterDynamicRoutes(routes) { + const res = [] + routes.forEach(route => { + if (route.permissions) { + if (auth.hasPermiOr(route.permissions)) { + res.push(route) + } + } else if (route.roles) { + if (auth.hasRoleOr(route.roles)) { + res.push(route) + } + } + }) + return res +} + export const loadView = (view) => { if (process.env.NODE_ENV === 'development') { return (resolve) => require([`@/views/${view}`], resolve) From ca2405c1040f204811dede20089a589f8b130bfe Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 19 Dec 2021 19:56:53 +0800 Subject: [PATCH 070/110] =?UTF-8?q?=E5=8D=87=E7=BA=A7log4j2=E5=88=B0?= =?UTF-8?q?=E5=AE=89=E5=85=A8=E7=89=88=E6=9C=AC=EF=BC=8C=E9=98=B2=E6=AD=A2?= =?UTF-8?q?=E6=BC=8F=E6=B4=9E=E9=A3=8E=E9=99=A9?= 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 df250e8fd..41994043d 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ 4.1.2 2.3 0.9.1 - 2.16.0 + 2.17.0 From a028b566edf0546b75ec6483337480132b8fb6d6 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 20 Dec 2021 09:46:17 +0800 Subject: [PATCH 071/110] =?UTF-8?q?=E9=9B=86=E6=88=90compression-webpack-p?= =?UTF-8?q?lugin=E6=8F=92=E4=BB=B6=E5=AE=9E=E7=8E=B0=E6=89=93=E5=8C=85Gzip?= =?UTF-8?q?=E5=8E=8B=E7=BC=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/package.json | 1 + ruoyi-ui/vue.config.js | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index 6d33bdf57..62f4bcee1 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -67,6 +67,7 @@ "babel-eslint": "10.1.0", "babel-plugin-dynamic-import-node": "2.3.3", "chalk": "4.1.0", + "compression-webpack-plugin": "5.0.2", "connect": "3.6.6", "eslint": "7.15.0", "eslint-plugin-vue": "7.2.0", diff --git a/ruoyi-ui/vue.config.js b/ruoyi-ui/vue.config.js index 36cd2025e..63bac6a51 100644 --- a/ruoyi-ui/vue.config.js +++ b/ruoyi-ui/vue.config.js @@ -5,6 +5,8 @@ function resolve(dir) { return path.join(__dirname, dir) } +const CompressionPlugin = require('compression-webpack-plugin') + const name = process.env.VUE_APP_TITLE || '若依管理系统' // 网页标题 const port = process.env.port || process.env.npm_config_port || 80 // 端口 @@ -55,7 +57,16 @@ module.exports = { alias: { '@': resolve('src') } - } + }, + plugins: [ + new CompressionPlugin({ + test: /\.(js|css|html)?$/i, // 压缩文件格式 + filename: '[path].gz[query]', // 压缩后的文件名 + algorithm: 'gzip', // 使用gzip压缩 + threshold: 10240, // 对超过10K的数据压缩 + minRatio: 0.8 // 压缩率小于1才会压缩 + }) + ], }, chainWebpack(config) { config.plugins.delete('preload') // TODO: need test From c28aa299bd80df8611d7f83caf118f973d159f50 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 20 Dec 2021 14:25:52 +0800 Subject: [PATCH 072/110] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BD=BF=E7=94=A8Gzi?= =?UTF-8?q?p=E8=A7=A3=E5=8E=8B=E7=BC=A9=E9=9D=99=E6=80=81=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/vue.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-ui/vue.config.js b/ruoyi-ui/vue.config.js index 63bac6a51..1a9e913df 100644 --- a/ruoyi-ui/vue.config.js +++ b/ruoyi-ui/vue.config.js @@ -59,11 +59,11 @@ module.exports = { } }, plugins: [ + // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件 new CompressionPlugin({ test: /\.(js|css|html)?$/i, // 压缩文件格式 filename: '[path].gz[query]', // 压缩后的文件名 algorithm: 'gzip', // 使用gzip压缩 - threshold: 10240, // 对超过10K的数据压缩 minRatio: 0.8 // 压缩率小于1才会压缩 }) ], From fd3a699ad87f7c043658a18d9ffd298ae0b96a69 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 21 Dec 2021 13:32:28 +0800 Subject: [PATCH 073/110] =?UTF-8?q?SQL=E5=B7=A5=E5=85=B7=E7=B1=BB=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=A3=80=E6=9F=A5=E5=85=B3=E9=94=AE=E5=AD=97=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/common/utils/sql/SqlUtil.java | 24 +++++++++++++++++++ 1 file changed, 24 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 ceff84132..71a7ae10f 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 @@ -10,6 +10,11 @@ import com.ruoyi.common.utils.StringUtils; */ public class SqlUtil { + /** + * 定义常用的 sql关键字 + */ + public static String SQL_REGEX = "select |insert |delete |update |drop |count |exec |chr |mid |master |truncate |char |and |declare "; + /** * 仅支持字母、数字、下划线、空格、逗号、小数点(支持多个字段排序) */ @@ -34,4 +39,23 @@ public class SqlUtil { return value.matches(SQL_PATTERN); } + + /** + * SQL关键字检查 + */ + public static void filterKeyword(String value) + { + if (StringUtils.isEmpty(value)) + { + return; + } + String[] sqlKeywords = StringUtils.split(SQL_REGEX, "\\|"); + for (int i = 0; i < sqlKeywords.length; i++) + { + if (StringUtils.indexOfIgnoreCase(value, sqlKeywords[i]) > -1) + { + throw new UtilException("参数存在SQL注入风险"); + } + } + } } From be412faf6c8bd8a815df0c7bbccf42b5e81ecd29 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 21 Dec 2021 13:32:40 +0800 Subject: [PATCH 074/110] =?UTF-8?q?=E5=8D=87=E7=BA=A7fastjson=E5=88=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=881.2.79?= 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 41994043d..20e4b0b2e 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ 2.3.2 2.2.0 1.4.0 - 1.2.78 + 1.2.79 5.8.2 5.9.0 2.11.0 From 7b23b6db6f4c094a5376be95bd9ef655945cbfb3 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 24 Dec 2021 12:00:29 +0800 Subject: [PATCH 075/110] =?UTF-8?q?=E5=8D=87=E7=BA=A7oshi=E5=88=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=ACv5.8.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 20e4b0b2e..58658dbc5 100644 --- a/pom.xml +++ b/pom.xml @@ -25,8 +25,8 @@ 2.2.0 1.4.0 1.2.79 - 5.8.2 - 5.9.0 + 5.8.6 + 5.10.0 2.11.0 1.4 3.2.2 From e4df0c6da1e1814a1dbfa76599954f3bf68073b1 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 24 Dec 2021 14:51:33 +0800 Subject: [PATCH 076/110] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=AD=97=E5=85=B8=E7=BB=84=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ruoyi/generator/util/VelocityUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java index 1dadf2ced..2ae6802e3 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java @@ -3,6 +3,7 @@ package com.ruoyi.generator.util; import java.util.ArrayList; import java.util.HashSet; import java.util.List; +import java.util.Set; import org.apache.velocity.VelocityContext; import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.constant.GenConstants; @@ -270,7 +271,7 @@ public class VelocityUtils public static String getDicts(GenTable genTable) { List columns = genTable.getColumns(); - List dicts = new ArrayList(); + Set dicts = new HashSet(); for (GenTableColumn column : columns) { if (!column.isSuperColumn() && StringUtils.isNotEmpty(column.getDictType()) && StringUtils.equalsAny( From 0e771a6c1b732772eaf0ebcea7a26f9098755d7d Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 27 Dec 2021 12:38:59 +0800 Subject: [PATCH 077/110] =?UTF-8?q?=E5=8D=87=E7=BA=A7spring-boot=E5=88=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=AC2.5.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 16 +--------------- .../com/ruoyi/quartz/config/ScheduleConfig.java | 2 +- ruoyi-ui/src/views/monitor/job/index.vue | 2 +- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index 58658dbc5..4974a225d 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,6 @@ 4.1.2 2.3 0.9.1 - 2.17.0 @@ -44,7 +43,7 @@ org.springframework.boot spring-boot-dependencies - 2.5.6 + 2.5.8 pom import @@ -151,19 +150,6 @@ ${fastjson.version} - - - org.apache.logging.log4j - log4j-api - ${log4j2.version} - - - - org.apache.logging.log4j - log4j-to-slf4j - ${log4j2.version} - - io.jsonwebtoken diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/config/ScheduleConfig.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/config/ScheduleConfig.java index e35eb26e4..04db2c9db 100644 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/config/ScheduleConfig.java +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/config/ScheduleConfig.java @@ -29,7 +29,7 @@ public class ScheduleConfig prop.put("org.quartz.threadPool.threadCount", "20"); prop.put("org.quartz.threadPool.threadPriority", "5"); // JobStore配置 - prop.put("org.quartz.jobStore.class", "org.quartz.impl.jdbcjobstore.JobStoreTX"); + 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"); diff --git a/ruoyi-ui/src/views/monitor/job/index.vue b/ruoyi-ui/src/views/monitor/job/index.vue index b8284ab91..84ea6af69 100644 --- a/ruoyi-ui/src/views/monitor/job/index.vue +++ b/ruoyi-ui/src/views/monitor/job/index.vue @@ -204,7 +204,7 @@ - + 立即执行 执行一次 From 1294f682659c45169d966e40e5cac5597cec84aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E5=B0=8F=E6=B3=95?= Date: Mon, 27 Dec 2021 15:33:22 +0800 Subject: [PATCH 078/110] fix https://gitee.com/y_project/RuoYi-Vue/issues/I4O5WD --- ruoyi-ui/src/components/Crontab/hour.vue | 228 +++++++++++------------ 1 file changed, 114 insertions(+), 114 deletions(-) diff --git a/ruoyi-ui/src/components/Crontab/hour.vue b/ruoyi-ui/src/components/Crontab/hour.vue index 29b88919f..4b1f1fcdb 100644 --- a/ruoyi-ui/src/components/Crontab/hour.vue +++ b/ruoyi-ui/src/components/Crontab/hour.vue @@ -1,114 +1,114 @@ - - - \ No newline at end of file + + + From d51e7cbb51a4871b78b2a680cb1670c0131da287 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 29 Dec 2021 11:04:09 +0800 Subject: [PATCH 079/110] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E6=9F=A5=E8=AF=A2=E9=80=89=E6=8B=A9=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E5=90=8E=E5=88=86=E9=A1=B5=E5=8F=82=E6=95=B0=E5=88=9D?= =?UTF-8?q?=E5=A7=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/system/user/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-ui/src/views/system/user/index.vue b/ruoyi-ui/src/views/system/user/index.vue index 81a216179..4b00e0322 100644 --- a/ruoyi-ui/src/views/system/user/index.vue +++ b/ruoyi-ui/src/views/system/user/index.vue @@ -495,7 +495,7 @@ export default { // 节点单击事件 handleNodeClick(data) { this.queryParams.deptId = data.id; - this.getList(); + this.handleQuery(); }, // 用户状态修改 handleStatusChange(row) { From 530b2a51d5b15d5c2ffd9df3f75e918d636f4ba0 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 30 Dec 2021 14:13:38 +0800 Subject: [PATCH 080/110] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8D=95=E8=AF=8D?= =?UTF-8?q?=E6=8B=BC=E5=86=99=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/api/system/user.js | 4 ++-- ruoyi-ui/src/utils/ruoyi.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ruoyi-ui/src/api/system/user.js b/ruoyi-ui/src/api/system/user.js index 577bea24c..ad227f97b 100644 --- a/ruoyi-ui/src/api/system/user.js +++ b/ruoyi-ui/src/api/system/user.js @@ -1,5 +1,5 @@ import request from '@/utils/request' -import { praseStrEmpty } from "@/utils/ruoyi"; +import { parseStrEmpty } from "@/utils/ruoyi"; // 查询用户列表 export function listUser(query) { @@ -13,7 +13,7 @@ export function listUser(query) { // 查询用户详细 export function getUser(userId) { return request({ - url: '/system/user/' + praseStrEmpty(userId), + url: '/system/user/' + parseStrEmpty(userId), method: 'get' }) } diff --git a/ruoyi-ui/src/utils/ruoyi.js b/ruoyi-ui/src/utils/ruoyi.js index 4cc5e24ea..0c4c77bbe 100644 --- a/ruoyi-ui/src/utils/ruoyi.js +++ b/ruoyi-ui/src/utils/ruoyi.js @@ -108,7 +108,7 @@ export function sprintf(str) { } // 转换字符串,undefined,null等转化为"" -export function praseStrEmpty(str) { +export function parseStrEmpty(str) { if (!str || str == "undefined" || str == "null") { return ""; } From f65cd6245de4757ecea7b6c127fa54f0786b514f Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 30 Dec 2021 14:14:40 +0800 Subject: [PATCH 081/110] =?UTF-8?q?=E9=98=B2=E9=87=8D=E5=A4=8D=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=A0=87=E8=AF=86=E7=BB=84=E5=90=88=EF=BC=88key=20+?= =?UTF-8?q?=20url=20+=20header=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../interceptor/impl/SameUrlDataInterceptor.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java index 33c9c876b..b956b3f25 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java @@ -60,14 +60,10 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor String url = request.getRequestURI(); // 唯一值(没有消息头则使用请求地址) - String submitKey = request.getHeader(header); - if (StringUtils.isEmpty(submitKey)) - { - submitKey = url; - } + String submitKey = StringUtils.trimToEmpty(request.getHeader(header)); - // 唯一标识(指定key + 消息头) - String cacheRepeatKey = Constants.REPEAT_SUBMIT_KEY + submitKey; + // 唯一标识(指定key + url + 消息头) + String cacheRepeatKey = Constants.REPEAT_SUBMIT_KEY + url + submitKey; Object sessionObj = redisCache.getCacheObject(cacheRepeatKey); if (sessionObj != null) From bb1af390a7025247fdef1e63ce871b47e8e369e6 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 30 Dec 2021 14:41:25 +0800 Subject: [PATCH 082/110] =?UTF-8?q?=E5=8D=87=E7=BA=A7log4j2=E5=88=B02.17.1?= =?UTF-8?q?=EF=BC=8C=E9=98=B2=E6=AD=A2=E6=BC=8F=E6=B4=9E=E9=A3=8E=E9=99=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pom.xml b/pom.xml index 4974a225d..ecbce07ce 100644 --- a/pom.xml +++ b/pom.xml @@ -32,6 +32,7 @@ 3.2.2 4.1.2 2.3 + 2.17.1 0.9.1 @@ -150,6 +151,19 @@ ${fastjson.version} + + + org.apache.logging.log4j + log4j-api + ${log4j2.version} + + + + org.apache.logging.log4j + log4j-to-slf4j + ${log4j2.version} + + io.jsonwebtoken From 6353f4ff094905021568ac5c7486cd3f6ad71632 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 31 Dec 2021 00:00:06 +0800 Subject: [PATCH 083/110] =?UTF-8?q?=E8=8B=A5=E4=BE=9D=203.8.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 4 +-- ruoyi-admin/pom.xml | 2 +- .../src/main/resources/application.yml | 2 +- ruoyi-common/pom.xml | 2 +- ruoyi-framework/pom.xml | 2 +- ruoyi-generator/pom.xml | 2 +- ruoyi-quartz/pom.xml | 2 +- ruoyi-system/pom.xml | 2 +- ruoyi-ui/package.json | 2 +- ruoyi-ui/src/views/index.vue | 35 ++++++++++++++++++- 10 files changed, 44 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index ecbce07ce..c024d33d7 100644 --- a/pom.xml +++ b/pom.xml @@ -6,14 +6,14 @@ com.ruoyi ruoyi - 3.8.0 + 3.8.1 ruoyi http://www.ruoyi.vip 若依管理系统 - 3.8.0 + 3.8.1 UTF-8 UTF-8 1.8 diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml index ca0631980..14769e515 100644 --- a/ruoyi-admin/pom.xml +++ b/ruoyi-admin/pom.xml @@ -5,7 +5,7 @@ ruoyi com.ruoyi - 3.8.0 + 3.8.1 4.0.0 jar diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 557179b40..286b1aeaa 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -3,7 +3,7 @@ ruoyi: # 名称 name: RuoYi # 版本 - version: 3.8.0 + version: 3.8.1 # 版权年份 copyrightYear: 2021 # 实例演示开关 diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index cbf4893a5..e18104ca1 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -5,7 +5,7 @@ ruoyi com.ruoyi - 3.8.0 + 3.8.1 4.0.0 diff --git a/ruoyi-framework/pom.xml b/ruoyi-framework/pom.xml index 2e8817bfa..f1b68c7c5 100644 --- a/ruoyi-framework/pom.xml +++ b/ruoyi-framework/pom.xml @@ -5,7 +5,7 @@ ruoyi com.ruoyi - 3.8.0 + 3.8.1 4.0.0 diff --git a/ruoyi-generator/pom.xml b/ruoyi-generator/pom.xml index 8ec90ea0d..b80b938cf 100644 --- a/ruoyi-generator/pom.xml +++ b/ruoyi-generator/pom.xml @@ -5,7 +5,7 @@ ruoyi com.ruoyi - 3.8.0 + 3.8.1 4.0.0 diff --git a/ruoyi-quartz/pom.xml b/ruoyi-quartz/pom.xml index 7d7a72631..c70da0dad 100644 --- a/ruoyi-quartz/pom.xml +++ b/ruoyi-quartz/pom.xml @@ -5,7 +5,7 @@ ruoyi com.ruoyi - 3.8.0 + 3.8.1 4.0.0 diff --git a/ruoyi-system/pom.xml b/ruoyi-system/pom.xml index a62fb550d..611cc8289 100644 --- a/ruoyi-system/pom.xml +++ b/ruoyi-system/pom.xml @@ -5,7 +5,7 @@ ruoyi com.ruoyi - 3.8.0 + 3.8.1 4.0.0 diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index 62f4bcee1..fc15b2e15 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -1,6 +1,6 @@ { "name": "ruoyi", - "version": "3.8.0", + "version": "3.8.1", "description": "若依管理系统", "author": "若依", "license": "MIT", diff --git a/ruoyi-ui/src/views/index.vue b/ruoyi-ui/src/views/index.vue index 75761cb75..f136d1aa9 100644 --- a/ruoyi-ui/src/views/index.vue +++ b/ruoyi-ui/src/views/index.vue @@ -147,6 +147,39 @@ 更新日志 + +

      +
    1. 新增Vue3前端代码生成模板
    2. +
    3. 新增图片预览组件
    4. +
    5. 新增压缩插件实现打包Gzip
    6. +
    7. 自定义xss校验注解实现
    8. +
    9. 自定义文字复制剪贴指令
    10. +
    11. 代码生成预览支持复制内容
    12. +
    13. 路由支持单独配置菜单或角色权限
    14. +
    15. 用户管理部门查询选择节点后分页参数初始
    16. +
    17. 修复用户分配角色属性错误
    18. +
    19. 修复打包后字体图标偶现的乱码问题
    20. +
    21. 修复菜单管理重置表单出现的错误
    22. +
    23. 修复版本差异导致的懒加载报错问题
    24. +
    25. 修复Cron组件中周回显问题
    26. +
    27. 修复定时任务多参数逗号分隔的问题
    28. +
    29. 修复根据ID查询列表可能出现的主键溢出问题
    30. +
    31. 修复tomcat配置参数已过期问题
    32. +
    33. 升级clipboard到最新版本2.0.8
    34. +
    35. 升级oshi到最新版本v5.8.6
    36. +
    37. 升级fastjson到最新版1.2.79
    38. +
    39. 升级spring-boot到最新版本2.5.8
    40. +
    41. 升级log4j2到2.17.1,防止漏洞风险
    42. +
    43. 优化下载解析blob异常提示
    44. +
    45. 优化代码生成字典组重复问题
    46. +
    47. 优化查询用户的角色组&岗位组代码
    48. +
    49. 优化定时任务cron表达式小时设置24
    50. +
    51. 优化用户导入提示溢出则显示滚动条
    52. +
    53. 优化防重复提交标识组合为(key+url+header)
    54. +
    55. 优化分页方法设置成通用方便灵活调用
    56. +
    57. 其他细节优化
    58. +
    +
    1. 新增配套并同步的Vue3前端版本
    2. @@ -717,7 +750,7 @@ export default { data() { return { // 版本号 - version: "3.8.0", + version: "3.8.1", }; }, methods: { From 6ef899d0006034a031277bd439e67432d9b4f7d8 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 31 Dec 2021 10:03:54 +0800 Subject: [PATCH 084/110] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=A4=B1=E6=95=88=E5=90=8E=E5=A4=9A=E6=AC=A1=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E5=A4=9A=E6=AC=A1=E5=BC=B9=E7=AA=97=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/utils/request.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/ruoyi-ui/src/utils/request.js b/ruoyi-ui/src/utils/request.js index 8ee43ccb4..12e535a64 100644 --- a/ruoyi-ui/src/utils/request.js +++ b/ruoyi-ui/src/utils/request.js @@ -7,6 +7,8 @@ import { tansParams, blobValidate } from "@/utils/ruoyi"; import { saveAs } from 'file-saver' let downloadLoadingInstance; +// 是否显示重新登录 +let isReloginShow; axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' // 创建axios实例 @@ -48,16 +50,25 @@ service.interceptors.response.use(res => { return res.data } if (code === 401) { - MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { + if (!isReloginShow) { + isReloginShow = true; + MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' } ).then(() => { + isReloginShow = false; store.dispatch('LogOut').then(() => { - location.href = '/index'; + // 如果是登录页面不需要重新加载 + if (window.location.hash.indexOf("#/login") != 0) { + location.href = '/index'; + } }) - }).catch(() => {}); + }).catch(() => { + isReloginShow = false; + }); + } return Promise.reject('无效的会话,或者会话已过期,请重新登录。') } else if (code === 500) { Message({ From cb6228800b36a69744a2815035be6a7d9cffd96f Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 1 Jan 2022 09:28:52 +0800 Subject: [PATCH 085/110] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=96=B0=E5=A2=9EJava=E7=B1=BB=E5=9E=8BBoolean?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/tool/gen/editTable.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/ruoyi-ui/src/views/tool/gen/editTable.vue b/ruoyi-ui/src/views/tool/gen/editTable.vue index 5be5c5054..26571d935 100644 --- a/ruoyi-ui/src/views/tool/gen/editTable.vue +++ b/ruoyi-ui/src/views/tool/gen/editTable.vue @@ -33,6 +33,7 @@ + From 7bc15245aa48e743ad42fbe5d53582a90cd450cf Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 1 Jan 2022 09:46:18 +0800 Subject: [PATCH 086/110] =?UTF-8?q?=E9=A2=84=E8=A7=88=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=A4=9A=E5=9B=BE=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/ImagePreview/index.vue | 121 ++++++++++-------- 1 file changed, 69 insertions(+), 52 deletions(-) diff --git a/ruoyi-ui/src/components/ImagePreview/index.vue b/ruoyi-ui/src/components/ImagePreview/index.vue index 44e27aac2..743d8d51d 100644 --- a/ruoyi-ui/src/components/ImagePreview/index.vue +++ b/ruoyi-ui/src/components/ImagePreview/index.vue @@ -1,67 +1,84 @@ From 10ae0bce65e6b33dbaec80d702372a39233775df Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 1 Jan 2022 09:50:35 +0800 Subject: [PATCH 087/110] =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=87=8F=E5=B0=91=E4=B8=80=E6=AC=A1=E8=A7=92=E8=89=B2=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=85=B3=E8=81=94=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/web/controller/system/SysUserController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java index 9aacc3be0..77fcff913 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java @@ -104,9 +104,10 @@ public class SysUserController extends BaseController ajax.put("posts", postService.selectPostAll()); if (StringUtils.isNotNull(userId)) { + SysUser sysUser = userService.selectUserById(userId); ajax.put(AjaxResult.DATA_TAG, userService.selectUserById(userId)); ajax.put("postIds", postService.selectPostListByUserId(userId)); - ajax.put("roleIds", roleService.selectRoleListByUserId(userId)); + ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList())); } return ajax; } From c9d19cbe56c73efd5ac64eddefedc5c657af996b Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 2 Jan 2022 10:29:15 +0800 Subject: [PATCH 088/110] =?UTF-8?q?=E7=A9=BA=E5=80=BC=E4=B8=8D=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E5=9B=9E=E6=98=BE=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/utils/ruoyi.js | 323 ++++++++++++++++++------------------ 1 file changed, 164 insertions(+), 159 deletions(-) diff --git a/ruoyi-ui/src/utils/ruoyi.js b/ruoyi-ui/src/utils/ruoyi.js index 0c4c77bbe..8e3cb0cea 100644 --- a/ruoyi-ui/src/utils/ruoyi.js +++ b/ruoyi-ui/src/utils/ruoyi.js @@ -1,3 +1,5 @@ + + /** * 通用js方法封装处理 * Copyright (c) 2019 ruoyi @@ -5,130 +7,133 @@ // 日期格式化 export function parseTime(time, pattern) { - if (arguments.length === 0 || !time) { - return null - } - const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}' - let date - if (typeof time === 'object') { - date = time - } else { - if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { - time = parseInt(time) - } else if (typeof time === 'string') { - time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm),''); - } - if ((typeof time === 'number') && (time.toString().length === 10)) { - time = time * 1000 - } - date = new Date(time) - } - const formatObj = { - y: date.getFullYear(), - m: date.getMonth() + 1, - d: date.getDate(), - h: date.getHours(), - i: date.getMinutes(), - s: date.getSeconds(), - a: date.getDay() - } - const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => { - let value = formatObj[key] - // Note: getDay() returns 0 on Sunday - if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] } - if (result.length > 0 && value < 10) { - value = '0' + value - } - return value || 0 - }) - return time_str + if (arguments.length === 0 || !time) { + return null + } + const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}' + let date + if (typeof time === 'object') { + date = time + } else { + if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { + time = parseInt(time) + } else if (typeof time === 'string') { + time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm), ''); + } + if ((typeof time === 'number') && (time.toString().length === 10)) { + time = time * 1000 + } + date = new Date(time) + } + const formatObj = { + y: date.getFullYear(), + m: date.getMonth() + 1, + d: date.getDate(), + h: date.getHours(), + i: date.getMinutes(), + s: date.getSeconds(), + a: date.getDay() + } + const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => { + let value = formatObj[key] + // Note: getDay() returns 0 on Sunday + if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] } + if (result.length > 0 && value < 10) { + value = '0' + value + } + return value || 0 + }) + return time_str } // 表单重置 export function resetForm(refName) { - if (this.$refs[refName]) { - this.$refs[refName].resetFields(); - } + if (this.$refs[refName]) { + this.$refs[refName].resetFields(); + } } // 添加日期范围 export function addDateRange(params, dateRange, propName) { - let search = params; - search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {}; - dateRange = Array.isArray(dateRange) ? dateRange : []; - if (typeof (propName) === 'undefined') { - search.params['beginTime'] = dateRange[0]; - search.params['endTime'] = dateRange[1]; - } else { - search.params['begin' + propName] = dateRange[0]; - search.params['end' + propName] = dateRange[1]; - } - return search; + let search = params; + search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {}; + dateRange = Array.isArray(dateRange) ? dateRange : []; + if (typeof (propName) === 'undefined') { + search.params['beginTime'] = dateRange[0]; + search.params['endTime'] = dateRange[1]; + } else { + search.params['begin' + propName] = dateRange[0]; + search.params['end' + propName] = dateRange[1]; + } + return search; } -// 回显数据字典 +// 回显数据字典 export function selectDictLabel(datas, value) { - var actions = []; - Object.keys(datas).some((key) => { - if (datas[key].value == ('' + value)) { - actions.push(datas[key].label); - return true; - } - }) - return actions.join(''); + var actions = []; + Object.keys(datas).some((key) => { + if (datas[key].value == ('' + value)) { + actions.push(datas[key].label); + return true; + } + }) + return actions.join(''); } // 回显数据字典(字符串数组) export function selectDictLabels(datas, value, separator) { - var actions = []; - var currentSeparator = undefined === separator ? "," : separator; - var temp = value.split(currentSeparator); - Object.keys(value.split(currentSeparator)).some((val) => { - Object.keys(datas).some((key) => { - if (datas[key].value == ('' + temp[val])) { - actions.push(datas[key].label + currentSeparator); - } - }) - }) - return actions.join('').substring(0, actions.join('').length - 1); + if(value === undefined) { + return ""; + } + var actions = []; + var currentSeparator = undefined === separator ? "," : separator; + var temp = value.split(currentSeparator); + Object.keys(value.split(currentSeparator)).some((val) => { + Object.keys(datas).some((key) => { + if (datas[key].value == ('' + temp[val])) { + actions.push(datas[key].label + currentSeparator); + } + }) + }) + return actions.join('').substring(0, actions.join('').length - 1); } // 字符串格式化(%s ) export function sprintf(str) { - var args = arguments, flag = true, i = 1; - str = str.replace(/%s/g, function () { - var arg = args[i++]; - if (typeof arg === 'undefined') { - flag = false; - return ''; - } - return arg; - }); - return flag ? str : ''; + var args = arguments, flag = true, i = 1; + str = str.replace(/%s/g, function () { + var arg = args[i++]; + if (typeof arg === 'undefined') { + flag = false; + return ''; + } + return arg; + }); + return flag ? str : ''; } // 转换字符串,undefined,null等转化为"" export function parseStrEmpty(str) { - if (!str || str == "undefined" || str == "null") { - return ""; - } - return str; + if (!str || str == "undefined" || str == "null") { + return ""; + } + return str; } // 数据合并 export function mergeRecursive(source, target) { - for (var p in target) { - try { - if (target[p].constructor == Object) { - source[p] = mergeRecursive(source[p], target[p]); - } else { - source[p] = target[p]; - } - } catch(e) { - source[p] = target[p]; - } + for (var p in target) { + try { + if (target[p].constructor == Object) { + source[p] = mergeRecursive(source[p], target[p]); + } else { + source[p] = target[p]; + } + } catch (e) { + source[p] = target[p]; } - return source; + } + return source; }; /** @@ -139,47 +144,47 @@ export function mergeRecursive(source, target) { * @param {*} children 孩子节点字段 默认 'children' */ export function handleTree(data, id, parentId, children) { - let config = { - id: id || 'id', - parentId: parentId || 'parentId', - childrenList: children || 'children' - }; + let config = { + id: id || 'id', + parentId: parentId || 'parentId', + childrenList: children || 'children' + }; - var childrenListMap = {}; - var nodeIds = {}; - var tree = []; + var childrenListMap = {}; + var nodeIds = {}; + var tree = []; - for (let d of data) { - let parentId = d[config.parentId]; - if (childrenListMap[parentId] == null) { - childrenListMap[parentId] = []; - } - nodeIds[d[config.id]] = d; - childrenListMap[parentId].push(d); - } + for (let d of data) { + let parentId = d[config.parentId]; + if (childrenListMap[parentId] == null) { + childrenListMap[parentId] = []; + } + nodeIds[d[config.id]] = d; + childrenListMap[parentId].push(d); + } - for (let d of data) { - let parentId = d[config.parentId]; - if (nodeIds[parentId] == null) { - tree.push(d); - } - } + for (let d of data) { + let parentId = d[config.parentId]; + if (nodeIds[parentId] == null) { + tree.push(d); + } + } - for (let t of tree) { - adaptToChildrenList(t); - } + for (let t of tree) { + adaptToChildrenList(t); + } - function adaptToChildrenList(o) { - if (childrenListMap[o[config.id]] !== null) { - o[config.childrenList] = childrenListMap[o[config.id]]; - } - if (o[config.childrenList]) { - for (let c of o[config.childrenList]) { - adaptToChildrenList(c); - } - } - } - return tree; + function adaptToChildrenList(o) { + if (childrenListMap[o[config.id]] !== null) { + o[config.childrenList] = childrenListMap[o[config.id]]; + } + if (o[config.childrenList]) { + for (let c of o[config.childrenList]) { + adaptToChildrenList(c); + } + } + } + return tree; } /** @@ -187,34 +192,34 @@ export function handleTree(data, id, parentId, children) { * @param {*} params 参数 */ export function tansParams(params) { - let result = '' - for (const propName of Object.keys(params)) { - const value = params[propName]; - var part = encodeURIComponent(propName) + "="; - if (value !== null && typeof (value) !== "undefined") { - if (typeof value === 'object') { - for (const key of Object.keys(value)) { - if (value[key] !== null && typeof (value[key]) !== 'undefined') { - let params = propName + '[' + key + ']'; - var subPart = encodeURIComponent(params) + "="; - result += subPart + encodeURIComponent(value[key]) + "&"; - } - } - } else { - result += part + encodeURIComponent(value) + "&"; - } - } - } - return result + let result = '' + for (const propName of Object.keys(params)) { + const value = params[propName]; + var part = encodeURIComponent(propName) + "="; + if (value !== null && typeof (value) !== "undefined") { + if (typeof value === 'object') { + for (const key of Object.keys(value)) { + if (value[key] !== null && typeof (value[key]) !== 'undefined') { + let params = propName + '[' + key + ']'; + var subPart = encodeURIComponent(params) + "="; + result += subPart + encodeURIComponent(value[key]) + "&"; + } + } + } else { + result += part + encodeURIComponent(value) + "&"; + } + } + } + return result } // 验证是否为blob格式 export async function blobValidate(data) { - try { - const text = await data.text(); - JSON.parse(text); - return false; - } catch (error) { - return true; - } -} + try { + const text = await data.text(); + JSON.parse(text); + return false; + } catch (error) { + return true; + } +} \ No newline at end of file From c8d9b3f8fc369b70bd6e81a697488d595748a1a5 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 2 Jan 2022 10:37:09 +0800 Subject: [PATCH 089/110] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=98=AF=E5=90=A6=E9=9C=80=E8=A6=81=E9=98=B2?= =?UTF-8?q?=E6=AD=A2=E6=95=B0=E6=8D=AE=E9=87=8D=E5=A4=8D=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/utils/request.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/ruoyi-ui/src/utils/request.js b/ruoyi-ui/src/utils/request.js index 12e535a64..107a28d67 100644 --- a/ruoyi-ui/src/utils/request.js +++ b/ruoyi-ui/src/utils/request.js @@ -4,6 +4,7 @@ import store from '@/store' import { getToken } from '@/utils/auth' import errorCode from '@/utils/errorCode' import { tansParams, blobValidate } from "@/utils/ruoyi"; +import cache from '@/plugins/cache' import { saveAs } from 'file-saver' let downloadLoadingInstance; @@ -23,6 +24,8 @@ const service = axios.create({ service.interceptors.request.use(config => { // 是否需要设置 token const isToken = (config.headers || {}).isToken === false + // 是否需要防止数据重复提交 + const isRepeatSubmit = (config.headers || {}).repeatSubmit === false if (getToken() && !isToken) { config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 } @@ -33,6 +36,29 @@ service.interceptors.request.use(config => { config.params = {}; config.url = url; } + if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) { + const requestObj = { + url: config.url, + data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data, + time: new Date().getTime() + } + const sessionObj = cache.session.getJSON('sessionObj') + if (sessionObj === undefined || sessionObj === null || sessionObj === '') { + cache.session.setJSON('sessionObj', requestObj) + } else { + const s_url = sessionObj.url; // 请求地址 + const s_data = sessionObj.data; // 请求数据 + const s_time = sessionObj.time; // 请求时间 + const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交 + if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) { + const message = '数据正在处理,请勿重复提交'; + console.warn(`[${s_url}]: ` + message) + return Promise.reject(new Error(message)) + } else { + cache.session.setJSON('sessionObj', requestObj) + } + } + } return config }, error => { console.log(error) From 8ba91fc9ddced1cfabed07edc0abff98feb17739 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 4 Jan 2022 09:10:49 +0800 Subject: [PATCH 090/110] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=AF=A6=E7=BB=86=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/web/controller/system/SysUserController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java index 77fcff913..e9be25e04 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java @@ -105,7 +105,7 @@ public class SysUserController extends BaseController if (StringUtils.isNotNull(userId)) { SysUser sysUser = userService.selectUserById(userId); - ajax.put(AjaxResult.DATA_TAG, userService.selectUserById(userId)); + ajax.put(AjaxResult.DATA_TAG, sysUser); ajax.put("postIds", postService.selectPostListByUserId(userId)); ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList())); } From b7452cc2815de77809a4537ba540b5c0f34a69c9 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 4 Jan 2022 10:49:59 +0800 Subject: [PATCH 091/110] update README.md --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 61938265c..3d7053780 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,14 @@ +

      + logo +

      +

      RuoYi v3.8.1

      +

      基于SpringBoot+Vue前后端分离的Java快速开发框架

      +

      + + + +

      + ## 平台简介 若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。 From f4f4cd9b1f9053a35af92f3e4ce0607f4968d4be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=A5=E4=BE=9D?= Date: Tue, 4 Jan 2022 19:50:01 +0800 Subject: [PATCH 092/110] Create FUNDING.yml --- .github/FUNDING.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..c2774d2ce --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: http://doc.ruoyi.vip/ruoyi-vue/other/donate.html # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] From 47842a1611adabfe3b9fd8081c9fe4f49e5687c6 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 4 Jan 2022 20:26:49 +0800 Subject: [PATCH 093/110] update donate --- .github/FUNDING.yml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index c2774d2ce..fbcab775d 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,12 +1 @@ -# These are supported funding model platforms - -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: http://doc.ruoyi.vip/ruoyi-vue/other/donate.html # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] +custom: http://doc.ruoyi.vip/ruoyi-vue/other/donate.html From db4c2d3dd55e5409d8c2b6ffabe95509b552ce5f Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 4 Jan 2022 20:27:08 +0800 Subject: [PATCH 094/110] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=9B=BE=E7=89=87=E6=94=AF=E6=8C=81=E9=A2=84?= =?UTF-8?q?=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/vm/vue/index-tree.vue.vm | 10 ++++++++-- .../src/main/resources/vm/vue/index.vue.vm | 10 ++++++++-- .../src/main/resources/vm/vue/v3/index-tree.vue.vm | 12 +++++++++--- .../src/main/resources/vm/vue/v3/index.vue.vm | 10 ++++++++-- 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm index 62b12d98d..adba807b4 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm @@ -105,6 +105,12 @@ {{ parseTime(scope.row.${javaField}, '{y}-{m}-{d}') }} +#elseif($column.list && $column.htmlType == "imageUpload") + + + #elseif($column.list && "" != $column.dictType) +#elseif($column.list && $column.htmlType == "imageUpload") + + + #elseif($column.list && "" != $column.dictType) +#elseif($column.list && $column.htmlType == "imageUpload") + + + #elseif($column.list && "" != $column.dictType) +#elseif($column.list && $column.htmlType == "imageUpload") + + + #elseif($column.list && "" != $column.dictType)