From 6e14601c7cd8312a8dcb372b341ea05c7b965a23 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 16 Dec 2021 16:34:20 +0800 Subject: [PATCH 01/52] =?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 02/52] =?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 03/52] =?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 04/52] =?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 05/52] =?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 06/52] =?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 07/52] =?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 08/52] =?UTF-8?q?=E9=9B=86=E6=88=90compression-webpack-plu?= =?UTF-8?q?gin=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 09/52] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BD=BF=E7=94=A8Gzip?= =?UTF-8?q?=E8=A7=A3=E5=8E=8B=E7=BC=A9=E9=9D=99=E6=80=81=E6=96=87=E4=BB=B6?= =?UTF-8?q?=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 10/52] =?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 11/52] =?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 12/52] =?UTF-8?q?=E5=8D=87=E7=BA=A7oshi=E5=88=B0=E6=9C=80?= =?UTF-8?q?=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 13/52] =?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 14/52] =?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 15/52] 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 16/52] =?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 17/52] =?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 18/52] =?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 19/52] =?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 20/52] =?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 21/52] =?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 22/52] =?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 23/52] =?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 24/52] =?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 25/52] =?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 26/52] =?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 27/52] =?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 28/52] 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 29/52] 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 30/52] 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 31/52] =?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)