1155 Commits
v3.2 ... master

Author SHA1 Message Date
8499225192 优化用户密码字段序列化配置 2025-12-05 14:59:14 +08:00
4a5e45d160 优化数据权限控制逻辑,放开permission限制 2025-12-04 17:31:57 +08:00
188e50ff1c 支持Excel导出对象的多个子列表 2025-12-04 16:32:30 +08:00
bd66cc7260 优化表单构建关闭页签销毁复制插件 2025-12-04 13:15:20 +08:00
866b47000c 忽略用户密码字段的JSON序列化 2025-12-03 14:38:14 +08:00
f38f8b2c3e 升级tomcat到最新版本9.0.112 2025-12-03 11:39:56 +08:00
faa86ac946 优化代码 2025-12-03 11:39:27 +08:00
ad280e824c 优化生成代码下载的zip文件名 2025-12-03 10:26:27 +08:00
6e1aa42ebe 网页标题设置新增SET_TITLE方法 2025-12-02 19:30:16 +08:00
315901041f 支持Excel导出对象的多个子列表 2025-12-02 19:13:04 +08:00
91263711d4 登录/注册页面底部版权信息修改为读取配置 2025-12-02 15:28:44 +08:00
9372d3401f 修复v3时间控件between选择后清空报错问题 2025-12-02 14:56:34 +08:00
0eaa090f4b 修复表单构建移除所有控件后切换路由回来空白问题 2025-12-02 13:07:37 +08:00
a5adee3c5f 修复comboReadDict属性下多个sheet出现的报错(ICWQ8E) 2025-11-13 11:35:04 +08:00
075e96466f 添加新群号:174569686 2025-10-05 20:10:10 +08:00
41496b6d8a 升级spring-security到安全版本 2025-09-05 09:18:13 +08:00
4a401984c1 升级fastjson到最新版2.0.58 2025-09-05 09:16:51 +08:00
e5faee66c8 修复固定头部时出现的导航栏偏移问题(ICV9OH) 2025-09-04 19:58:16 +08:00
7558c176eb 支持防盗链功能 2025-09-02 11:30:54 +08:00
4a5b0e6079 升级oshi到最新版本6.8.3 2025-08-28 13:33:23 +08:00
08637e31e5 优化代码 2025-08-28 13:32:57 +08:00
512b157801 优化代码 2025-08-27 15:34:24 +08:00
5e8efaa94a !1082 修复每次登录把部门id更新为null
Merge pull request !1082 from afterglow/master
2025-08-27 06:48:16 +00:00
5f11fed41b 用户导入添加验证提示 2025-08-23 11:13:51 +08:00
b60b5de750 优化布局设置显示 2025-08-23 11:12:42 +08:00
lcs
41ff3843e6 修复每次登录把部门id更新为null 2025-08-22 16:01:01 +08:00
6a2e8a35e9 修复用户归属部门无法修改为空问题 2025-08-21 14:47:48 +08:00
769165575f columns default value 2025-08-09 16:11:36 +08:00
18c8d4ec9c 显示列信息支持对象格式 2025-08-09 13:21:54 +08:00
191fd29301 自动识别json对象白名单配置范围缩小 2025-08-09 10:57:26 +08:00
47510fe2de 升级tomcat到最新版本9.0.108 2025-08-07 15:24:27 +08:00
725c7dcea2 添加新群号:191164766 2025-06-20 11:39:20 +08:00
158ccaebe0 优化定时任务包名白名单匹配方式 2025-06-20 11:33:25 +08:00
7b9060af26 优化Excel统计行数值的单元格样式显示 2025-06-19 14:47:49 +08:00
1a2f20e859 升级oshi到最新版本6.8.2 2025-06-18 13:51:41 +08:00
09faecb5d3 升级tomcat到最新版本9.0.106 2025-06-18 13:40:59 +08:00
d46e62a21a 用户头像更换后移除旧头像文件 2025-06-06 14:58:01 +08:00
fa88922637 若依 3.9.0 2025-05-28 09:04:45 +08:00
65159934ab 注册账号设置默认密码最后更新时间 2025-05-26 10:57:49 +08:00
1642bba612 升级fastjson到最新版2.0.57 2025-05-26 08:59:40 +08:00
a7a61fee8d update vue.config.js 2025-05-24 14:31:02 +08:00
db6d5d34e6 添加底部版权信息及开关 2025-05-24 14:24:23 +08:00
9ceca3a68e 添加页签图标显示开关功能 2025-05-23 14:56:38 +08:00
cf2579612c update pwdUpdateDate 2025-05-23 10:44:51 +08:00
c0355a0f5a 账号密码支持自定义更新周期 2025-05-23 09:04:50 +08:00
8ff013552a 初始密码支持自定义修改策略 2025-05-22 23:03:30 +08:00
673249d373 升级tomcat到最新版本9.0.105 2025-05-15 10:54:38 +08:00
fe3a92a812 升级oshi到最新版本6.8.1 2025-05-15 09:05:21 +08:00
67b6a0e11b 升级commons.io到最新版本2.19.0 2025-05-15 09:04:36 +08:00
bc70351e34 delete vue-meta 2025-05-15 08:52:28 +08:00
fe0c1fcb5b delete eslint 2025-05-15 08:13:34 +08:00
9f39dfd0c1 优化导航栏显示昵称&设置 2025-05-09 13:45:39 +08:00
131abe876d 菜单搜索支持键盘选择&悬浮主题背景 2025-05-07 13:22:43 +08:00
46708ceee4 图片上传组件新增disabled属性 2025-05-06 19:13:32 +08:00
ecd201550f add columnName Drag 2025-05-06 14:52:36 +08:00
ff3f3f2631 !1013 修复图片上传组件在同一页面中被多次引用时,仅有第一个组件拖拽功能生效的问题
Merge pull request !1013 from 稚屿/N/A
2025-05-06 05:03:41 +00:00
d3cc8f0fb7 !1012 修复文件上传组件在同一页面中被多次引用时,仅有第一个组件拖拽功能生效的问题
Merge pull request !1012 from 稚屿/N/A
2025-05-06 05:03:36 +00:00
6cafa3373e 修复图片上传组件在同一页面中被多次引用时,仅有第一个组件拖拽功能生效的问题
Signed-off-by: 稚屿 <1491182878@qq.com>
2025-05-06 04:53:32 +00:00
42fbf09dde 修复图片上传组件在同一页面中被多次引用时,仅有第一个组件拖拽功能生效的问题
Signed-off-by: 稚屿 <1491182878@qq.com>
2025-05-06 04:48:46 +00:00
88b0f5bcb2 update icon 2025-05-05 11:20:27 +08:00
e852fdb687 上传组件新增拖动排序属性 2025-04-30 10:28:59 +08:00
baf2f6f46b 优化Excel匹配数值型.0结尾 2025-04-28 11:24:24 +08:00
e19f1abfeb update editor index 2025-04-27 14:02:36 +08:00
38ed092de7 remove all semicolons 2025-04-27 10:05:51 +08:00
27a037ed3d Excel导入导出支持多图片 2025-04-25 10:09:21 +08:00
87173cbe75 富文本复制粘贴图片上传至url 2025-04-24 14:23:29 +08:00
29a5b6da53 update vue.config.js 2025-04-24 11:08:10 +08:00
b1d2139559 update package.json 2025-04-24 11:07:54 +08:00
43d78c2cf5 优化低版本node无法启动的问题 2025-04-22 12:05:43 +08:00
8f4eb24bf2 优化代码 2025-04-22 12:03:31 +08:00
a9f9133e31 显隐列组件支持全选/全不选 2025-04-21 15:21:51 +08:00
09810ccf1d 优化菜单搜索查询页 2025-04-21 13:22:00 +08:00
0d9fb8b5c0 支持文件&图片组件自定义地址&参数 2025-04-18 12:55:58 +08:00
c6b0efcdc2 优化角色禁用不允许分配 2025-04-17 15:08:10 +08:00
84fef1f675 update status name 2025-04-17 15:07:38 +08:00
11fed08b56 添加新群号:287842588 2025-04-01 19:15:21 +08:00
f83b6fbfa2 remove dev runjs 2025-03-18 15:49:01 +08:00
eef81e6ca9 !997 登录页和注册页表头使用VUE_APP_TITLE配置值
Merge pull request !997 from myifengs/master
2025-03-18 07:48:23 +00:00
5a03a754e8 登录页肯注册页表头使用VUE_APP_TITLE配置值 2025-03-18 14:53:46 +08:00
245dea7215 升级tomcat到最新版本9.0.102 2025-03-14 16:09:22 +08:00
51632f8e60 优化代码 2025-03-14 16:09:01 +08:00
525ebf92d2 菜单管理新增路由名称 2025-03-06 11:02:21 +08:00
d3b23a831e 优化代码 2025-03-04 20:03:11 +08:00
89ab3bd058 !990 优化服务监控和缓存监控页面,页边距保持一致
Merge pull request !990 from NewYoung208/master
2025-03-04 11:18:04 +00:00
9e16beb48f !989 update ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java.
Merge pull request !989 from 程子/N/A
2025-03-04 11:16:45 +00:00
8d5ecc7ff4 优化服务监控和缓存监控页面,页边距保持一致 2025-03-04 16:58:16 +08:00
6e314dd3e8 update ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java.
添加String转换Boolean值时对(是、否)的支持

Signed-off-by: 程子 <395030787@qq.com>
2025-03-03 08:04:15 +00:00
193c256e71 优化顶部菜单搜索栏为多层级显示(IBESXH) 2025-03-03 12:07:38 +08:00
4df52a6b40 优化导出Excel日期格式双击离开后与设定的格式不一致问题 2025-03-01 15:21:22 +08:00
079b7eeecf 优化代码 2025-03-01 15:17:01 +08:00
ba24010709 pagination更换成flex布局 2025-03-01 15:07:43 +08:00
bd257f85e6 优化前端处理路由函数代码 2025-03-01 15:07:21 +08:00
40c7ca34a8 优化前端树结构性能问题 2025-03-01 14:53:39 +08:00
1ef73d7360 修复代码生成主子表校验必填失效问题 2025-02-28 21:52:56 +08:00
bd233fd62f 代码生成列表支持按时间排序 2025-02-28 19:38:34 +08:00
fabddc518a 文件上传组件新增类型 2025-02-28 19:36:25 +08:00
ca61b6c68d 优化空指针异常时无法获取错误信息问题 2025-02-28 19:35:13 +08:00
51e5cf2a09 升级tomcat到最新版本9.0.100 2025-02-28 13:00:01 +08:00
00acc37916 文件上传组件新增disabled属性 2025-02-28 12:59:41 +08:00
511ff0f125 优化代码 2025-02-28 12:58:03 +08:00
bf46e38c29 添加新群号 2025-01-15 15:07:57 +08:00
698a5198d9 copyright 2025 2025-01-07 10:43:54 +08:00
5e6c917ab0 若依 3.8.9 2024-12-30 08:49:55 +08:00
9a51563144 代码生成新增配置是否允许文件覆盖到本地 2024-12-25 15:48:16 +08:00
3b2704c181 优化导入带标题文件关闭清理 2024-12-25 15:47:32 +08:00
7232217061 update sqlkeyword 2024-12-25 00:05:16 +08:00
25fd29c5ea 优化特殊字符密码修改失败问题 2024-12-17 14:27:18 +08:00
2d6a6a162f 优化TopNav内链菜单点击没有高亮(IB8WHJ) 2024-12-17 11:56:51 +08:00
164c62743f 优化菜单管理切换Mini布局错乱问题 2024-12-17 11:24:10 +08:00
4ee169b0c8 update README 2024-12-13 20:07:48 +08:00
d487ffc92f 用户管理过滤掉已禁用部门(IB5H7F) 2024-12-11 11:20:09 +08:00
5a1e7bae2c 修改主题样式本地读取 2024-12-07 17:06:50 +08:00
1810f30491 白名单支持对通配符路径匹配 2024-12-04 08:51:17 +08:00
6efceac460 Excel注解支持wrapText是否允许内容换行 2024-12-03 08:58:44 +08:00
77a6350460 修复导出子列表对象只能在最后的问题 2024-12-02 20:36:53 +08:00
58a21ff9d7 !961 修复默认关闭Tags-Views时,内链页面打不开
Merge pull request !961 from Lyb刘同学/master
2024-11-27 09:28:06 +00:00
7f507f5dfa 修复默认关闭Tags-Views时,内链页面打不开 2024-11-27 17:24:53 +08:00
a1a45ef7ac !958 修复TopNav无法正确获取active的问题
Merge pull request !958 from Lyb刘同学/N/A
2024-11-27 00:55:53 +00:00
b343308a97 修复TopNav无法正确获取active的问题
Signed-off-by: Lyb刘同学 <1553592282@qq.com>
2024-11-26 09:24:21 +00:00
0bf7457eb7 优化代码 2024-11-25 22:27:10 +08:00
0f77f524d0 面板兼容移动端显示 2024-11-25 15:39:49 +08:00
747d816be2 参数键值更换为多行文本 2024-11-25 12:15:21 +08:00
262d9e1ff0 菜单面包屑导航支持多层级显示 2024-11-22 20:44:39 +08:00
ab37956874 分栏参数微调 2024-11-22 14:45:58 +08:00
86ab3bf600 用户管理支持分栏拖动 2024-11-22 12:19:56 +08:00
f76908912e 用户头像http(s)链接支持 2024-11-20 10:42:41 +08:00
8df4c72ad1 update .env.staging 2024-11-20 10:41:20 +08:00
6bdcbabc09 update pom.xml 2024-11-08 16:31:54 +08:00
58fca720a9 升级pom依赖到安全版本 2024-11-08 16:24:14 +08:00
e4ccbc6601 支持自定义显示Excel属性列 2024-11-07 22:15:27 +08:00
430e6d4dea 升级spring-framework到安全版本 2024-11-07 22:14:51 +08:00
a0e6295693 升级oshi到最新版本6.6.5 2024-11-05 16:23:52 +08:00
52ba823328 优化无用户编号不校验数据权限 2024-11-05 16:23:42 +08:00
91ae9a164c 校检文件名是否包含特殊字符 2024-11-05 12:49:40 +08:00
d3326987a4 优化身份证脱敏正则 2024-10-21 16:19:17 +08:00
4de087b1ad !937 update ruoyi-ui/src/components/ImageUpload/index.vue.
Merge pull request !937 from AZP/N/A
2024-10-21 08:05:26 +00:00
AZP
5b959b32d7 update ruoyi-ui/src/components/ImageUpload/index.vue.
【fix】修复后台前端上传图片如果图片路径已经携带域名就无需增加前缀域名

Signed-off-by: AZP <2198774759@qq.com>
2024-10-21 03:39:18 +00:00
4358621473 优化权限更新后同步缓存 2024-10-21 10:24:45 +08:00
adb8d51932 操作日志记录DELETE请求参数(IAMV6F) 2024-10-17 12:42:40 +08:00
08a5deb285 升级fastjson到最新版2.0.53 2024-10-17 12:42:24 +08:00
dc9f3ee722 升级quill到最新版本2.0.2 2024-10-15 16:18:02 +08:00
78bb30bb5f 修复码生成上级菜单显示问题(I9CTIJ) 2024-09-27 16:15:17 +08:00
5fad997d38 修复角色禁用权限不失效问题(IAA8ZX) 2024-09-21 11:28:52 +08:00
22a795d041 优化代码 2024-09-08 10:29:41 +08:00
8a0a3a03fe 升级oshi到最新版本6.6.3 2024-08-30 21:46:03 +08:00
ad86486285 update sqlkeyword 2024-08-30 21:45:16 +08:00
3ef6000794 修改时间范围日期格式 2024-07-08 16:45:36 +08:00
f812e99a0d remove sub resultType 2024-07-08 16:38:34 +08:00
2feae7619f avatar add headers 2024-07-02 16:08:30 +08:00
212e3b4977 升级axios到最新版本0.28.1 2024-07-02 12:58:28 +08:00
99e66bf11c 若依 3.8.8 2024-06-30 08:02:22 +08:00
a96d4bf2ed 菜单管理新增路由名称 2024-06-29 19:08:09 +08:00
8264b8fb31 删除多余的依赖 2024-06-27 11:08:31 +08:00
4ec32367fd 升级core-js到最新版本3.37.1 2024-06-27 10:22:55 +08:00
9e8aa14348 优化查表特殊字符使用反斜杠进行转义 2024-06-27 10:22:38 +08:00
10f68b97af 升级spring-security到安全版本,防止漏洞风险 2024-06-26 17:43:14 +08:00
8eff83e2b4 优化代码 2024-06-26 17:40:01 +08:00
7b064d84bb 升级druid到最新版本1.2.23 2024-06-25 12:29:13 +08:00
88560a7aa5 升级oshi到最新版本6.6.1 2024-06-25 12:28:50 +08:00
e14f40670a 优化代码 2024-06-25 12:27:21 +08:00
5b98495067 cron生成的表达式hour优化 2024-06-25 12:02:23 +08:00
259dc67728 优化数据权限代码 2024-06-05 12:30:43 +08:00
bc7a607033 Excel注解新增属性comboReadDict 2024-06-02 19:29:11 +08:00
161cd2b1ea 优化代码生成主子表关联查询方式 2024-06-02 19:28:40 +08:00
7480fb4020 优化导入Excel时设置dictType属性重复查缓存问题 2024-05-30 13:35:43 +08:00
906c3a68b8 添加新群号:151450850 2024-05-29 14:48:56 +08:00
084bab3494 update sql 2024-05-29 14:48:40 +08:00
cc0efa3330 优化代码 2024-05-29 14:48:23 +08:00
f46b1bbebd 限制用户操作数据权限范围 2024-05-29 14:48:03 +08:00
e5f30b1a19 升级spring-framework到安全版本,防止漏洞风险 2024-04-11 16:43:48 +08:00
1140a6c333 新增数据脱敏过滤注解 2024-04-08 13:16:27 +08:00
86ca404dbf 设置表格头单元格文本形式 2024-03-22 16:44:54 +08:00
11320b2e13 Excel注解ColumnType类型新增文本 2024-03-22 16:23:19 +08:00
905c08fb2c 升级oshi到最新版本6.5.0 2024-03-19 16:38:37 +08:00
9386645150 定义Locale默认国际化配置 2024-03-19 16:38:03 +08:00
bf3e2115e3 update vue.config.js 2024-03-18 14:28:28 +08:00
61eb54e4a1 更新compressionPlugin到6.1.2以兼容node18+ 2024-03-18 14:11:26 +08:00
d93e2b9df0 定时任务白名单配置范围缩小 2024-03-11 11:07:29 +08:00
50339c6f73 update copyright 2024 2024-03-11 10:47:55 +08:00
b83f2ff60b 添加新群号:138988063 2024-03-11 10:47:40 +08:00
66128f140f joblog order by 2024-03-11 09:42:15 +08:00
8c990ae9fc 用户密码新增非法字符验证 2024-03-01 21:53:57 +08:00
8836d31d77 升级oshi到最新版本6.4.13 2024-03-01 14:33:56 +08:00
2f624ab5f4 代码生成新增创建表结构功能 2024-03-01 14:33:09 +08:00
80f96b4915 升级oshi到最新版本6.4.11 2024-01-25 11:41:57 +08:00
7e9d050432 update http user-agent 2024-01-25 11:41:20 +08:00
649cfe8652 优化匹配方式 2024-01-25 11:34:25 +08:00
e9ae7ae5f3 !825 update: 修改退出处理类的日志记录和返回内容
Merge pull request !825 from 致远/master
2024-01-05 05:01:24 +00:00
3cc6fb5535 update: 修改退出处理类的日志记录和返回内容 2024-01-04 21:11:13 +08:00
a7bfd3b2d6 !822 删除未生效代码
Merge pull request !822 from mrzxc/fixbug/unuseCodeDelete
2024-01-02 02:20:43 +00:00
08d0326718 fix: delete unuse code 2023-12-25 10:22:05 +08:00
3f4ac65a31 remove packages 2023-12-13 11:51:17 +08:00
94d5c174aa 添加新群号:161281055 2023-12-13 11:47:35 +08:00
e719ac8cff !817 密码输入错误时,登录日志重复
Merge pull request !817 from 也曾为你像超人/N/A
2023-12-13 03:46:20 +00:00
a9bcfc66c3 密码输入错误时,登录日志重复
Signed-off-by: 也曾为你像超人 <1553592282@qq.com>
2023-12-10 14:18:35 +00:00
36b900cef8 若依 3.8.7 2023-12-08 09:03:30 +08:00
ac9302e2a2 升级element-ui到最新版本2.15.14 2023-12-07 11:08:03 +08:00
0f7e3a744e 删除无用的代码 2023-12-07 11:07:30 +08:00
45656b271a 升级oshi到最新版本6.4.8 2023-12-05 11:28:42 +08:00
323e3b7371 升级pagehelper到最新版1.4.7 2023-12-05 11:28:18 +08:00
bfbaa9e7b5 升级druid到最新版本1.2.20 2023-12-05 11:28:05 +08:00
2253a146b3 update fastjson2 2023-12-05 10:48:22 +08:00
2070a9252a 操作日志记录部门名称 2023-12-05 10:47:39 +08:00
e231d78469 修复代码生成导入后必填项与数据库不匹配问题 2023-12-05 10:45:54 +08:00
f74454b61a 删除无用的实例演示开关配置 2023-12-05 10:44:50 +08:00
d71ee5dba1 显隐列组件支持复选框弹出类型 2023-12-01 11:20:12 +08:00
78b1ac4a60 代码生成支持选择前端模板类型 2023-11-30 09:38:07 +08:00
966a17123f 优化代码 2023-11-30 09:37:36 +08:00
42bb8f6445 优化头像上传参数新增文件名称 2023-11-29 12:41:04 +08:00
72e4cd9fb3 优化字典标签支持自定义分隔符 2023-11-29 12:40:47 +08:00
1525bd8b54 优化下载zip方法新增遮罩层 2023-11-29 12:40:01 +08:00
b8e2eeaaf8 优化缓存监控图表支持跟随屏幕大小自适应调整 2023-11-29 12:39:22 +08:00
cbcfabee2a 优化代码 2023-11-29 12:38:45 +08:00
e6d0599b25 优化个人中心/基本资料修改时数据显示问题 2023-11-28 12:36:30 +08:00
b224cebab7 防止高频率定时任务不执行问题 2023-11-28 12:35:04 +08:00
f880dee7a4 !804 update ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java.
Merge pull request !804 from 刚刚好/N/A
2023-11-28 04:07:51 +00:00
f16875c9af !799 update ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java.
Merge pull request !799 from 张利/N/A
2023-11-28 04:04:36 +00:00
a90355eb5e !791 优化白名单页面放行逻辑
Merge pull request !791 from 也曾为你像超人/N/A
2023-11-28 03:54:05 +00:00
386f32a3b7 update ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java.
提交错别字

Signed-off-by: 刚刚好 <380862139@qq.com>
2023-11-12 02:38:46 +00:00
4ca30f08d6 修改权限字符匹配方式 2023-11-10 15:46:27 +08:00
73f881c7d3 修复五级路由缓存无效问题 2023-11-10 15:31:30 +08:00
b357aedaa3 修复内链iframe没有传递参数问题(I8DUOJ) 2023-11-10 11:13:16 +08:00
8cf8c8acd0 修复外链带端口出现的异常(I86J4B) 2023-11-07 11:38:19 +08:00
fbab383bd7 update ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java.
此处新密码加密了两次,多余的操作,且会导致新生成的数据库密码与缓存中的密码不同,如果修改的不对还请讲解回复下,谢谢。

Signed-off-by: 张利 <zhangli_wei555@163.com>
2023-11-02 02:57:04 +00:00
d8255edf84 新增编程式判断资源访问权限 2023-11-01 16:02:53 +08:00
eff42d8b0f !797 修复字典表详情页面搜索bug
Merge pull request !797 from 也曾为你像超人/N/A
2023-11-01 01:57:49 +00:00
1f753e3d84 修复字典表详情页面搜索bug
Signed-off-by: 也曾为你像超人 <1553592282@qq.com>
2023-10-30 03:50:19 +00:00
72d4069537 优化数字金额大写转换精度丢失问题(I81IJA) 2023-10-27 12:25:54 +08:00
76205588f0 update ruoyi-ui/src/permission.js.
Signed-off-by: 也曾为你像超人 <1553592282@qq.com>
2023-10-24 07:45:03 +00:00
7b4ba0146b 升级fastjson到最新版2.0.41 2023-10-21 14:44:02 +08:00
3963e86537 升级oshi到最新版本6.4.6 2023-10-21 14:34:05 +08:00
7098acc968 登录不做数据重复提交验证 2023-10-21 14:31:12 +08:00
079ac841f3 添加新群号:174951577 2023-10-09 21:27:00 +08:00
0434b4ca7a 去掉多余的参数 2023-10-09 21:26:40 +08:00
8873dc9b64 富文本Editor组件检验图片格式 2023-10-02 12:45:27 +08:00
078a3aad5a 修复HeaderSearch组件跳转query参数丢失问题 2023-09-28 22:24:25 +08:00
207a9ce855 操作日志列表新增IP地址查询 2023-09-27 15:21:59 +08:00
9ced1e9766 全局数据存储用户编号 2023-09-27 15:21:37 +08:00
1926840204 优化菜单管理类型为按钮状态可选 2023-09-18 15:04:34 +08:00
006d46ad07 修复自定义字典样式不生效的问题(I81F03) 2023-09-14 16:55:07 +08:00
f5a1b0c550 删除无用的传参 2023-09-01 09:37:16 +08:00
4a78fe116d 优化TopNav菜单没有图标svg不显示 2023-08-31 10:18:25 +08:00
3e95dd21f2 !772 修改未登录访问需要登录的资源,在登录后重定向丢失请求参数问题
Merge pull request !772 from who's hu/pr
2023-08-31 02:17:32 +00:00
491b0f3db8 修复字典缓存删除方法参数错误问题(I7UDIR) 2023-08-23 14:54:20 +08:00
16d8b71e21 update ruoyi-ui/src/permission.js.
由于重定向url存在 http://xxx.xx.xxx/{id}?param={a}&name={b} 的场景, 当未登录访问时, 通过改js封装登录后重定向参数, 会丢失?后的query params
如:
访问 http://localhost:1024/core/doc/doc?id=1683734914907807745&version=31
期望 http://localhost:1024/login?redirect=%2Fcore%2Fdoc%2Fdoc%3Fid%3D1683734914907807745%26version%3D31
实际通过 to.fullPath 封装后 获得 http://localhost:1024/login?redirect=%2Fcore%2Fdoc%2Fdoc%3Fid%3D1683734914907807745&version=31

登录成功跳转到重定向参数url后, 导致version参数丢失.
需要对 to.fullPath 进行一次编码, 以保证重定向前 to.fullPath 的完整性.
通过 ${encodeURIComponent(to.fullPath)} 获得 http://localhost:1024/login?redirect=%2Fcore%2Fdoc%2Fdoc%3Fid%3D1683734914907807745%26version%3D31 完整url



Signed-off-by: who's hu <hup_dev@outlook.com>
2023-08-22 09:25:19 +00:00
90260ce2f9 修复Excels导入时无法获取到dictType字典值问题(I7M4PW) 2023-08-21 15:52:30 +08:00
d58942c506 防重复提交数据大小限制(I7KZDA) 2023-08-21 11:57:14 +08:00
6a742e1d1b Excel导入数据临时文件无法删除问题(I7KIXX) 2023-08-19 15:43:57 +08:00
5b61aea064 修复树模板父级编码变量错误(I7JZ0L) 2023-08-19 14:34:30 +08:00
45ef542687 升级fastjson到最新版2.0.39 2023-08-15 12:17:27 +08:00
4ac7a1aa1f 升级commons.io到最新版本2.13.0 2023-08-15 11:31:38 +08:00
c5e4459bb8 优化代码 2023-08-15 11:30:49 +08:00
8f67bf416b 升级oshi到最新版本6.4.4 2023-08-14 19:11:46 +08:00
ab99a72b65 优化代码 2023-08-14 19:11:13 +08:00
7c9423657e Excel自定义数据处理器增加单元格/工作簿对象 2023-08-14 17:42:44 +08:00
128b186b8e 优化定时任务状态页面显示 2023-08-14 17:42:24 +08:00
68ac40eda9 update maven-plugin 2023-08-14 17:41:52 +08:00
5557433235 添加新群号:143961921 2023-07-28 11:12:09 +08:00
2517e9dddb 优化登录提示信息(I6ADCR) 2023-07-24 15:16:52 +08:00
a0595711ca 优化页签在Firefox浏览器被遮挡的问题 2023-07-06 22:09:16 +08:00
1ffb6379f7 排序属性orderBy参数限制长度 2023-07-06 22:09:02 +08:00
4d5c204b9a 优化代码 2023-07-06 22:08:47 +08:00
8ee740ef49 update sql 2023-07-06 22:07:00 +08:00
6a811d9824 若依 3.8.6 2023-06-30 08:43:54 +08:00
1c9c076280 升级oshi到最新版本6.4.3 2023-06-29 08:50:27 +08:00
918f94d8da 升级fastjson到最新版2.0.34 2023-06-29 08:38:33 +08:00
5db610d16f optimized code 2023-06-28 21:31:25 +08:00
cc6f983ee3 升级spring-boot到最新版本2.5.15 2023-06-24 14:49:03 +08:00
afe2852bbb update banner.txt 2023-06-24 14:48:54 +08:00
9c7d302b94 升级element-ui到最新版本2.15.13 2023-06-24 10:57:40 +08:00
9e66ada9c1 优化代码 2023-06-24 10:57:05 +08:00
a63eec3be4 !714 修改侧边栏的平台标题内容与process.env.VUE_APP_TITLE保持同步
Merge pull request !714 from Yakov/N/A
2023-06-24 02:16:00 +00:00
51990695f5 !729 update ruoyi-admin/src/main/resources/application.yml.
Merge pull request !729 from WhiskyZulu/N/A
2023-06-24 02:15:34 +00:00
a7b8f2ee90 !722 update ruoyi-admin/src/main/resources/banner.txt.
Merge pull request !722 from 万河/N/A
2023-06-24 02:13:44 +00:00
67ba621db6 update ruoyi-admin/src/main/resources/application.yml.
注释不太对,“数组计算”改为“数字计算”

Signed-off-by: WhiskyZulu <a913681304@qq.com>
2023-06-05 01:44:12 +00:00
05feef34c7 update ruoyi-admin/src/main/resources/banner.txt.
线条填歪了,看着难受

Signed-off-by: 万河 <12894283+science-01@user.noreply.gitee.com>
2023-05-18 08:53:14 +00:00
be0b36f6b9 update ruoyi-ui/src/layout/components/Sidebar/Logo.vue.
修改了第38行的/* title: '若依后台管理系统',  */ 为/* title: process.env.VUE_APP_TITLE, */,使得侧边栏的平台标题内容可以和vue.config.js里面的process.env.VUE_APP_TITLE保持同步。

Signed-off-by: yangfanao <2364917935@qq.com>
2023-04-25 09:35:36 +00:00
69bbccbd76 添加新群号:136919097 2023-04-23 15:46:53 +08:00
1eb7b3a03f !713 缓存列表:多次清除操作,提示不变的问题
Merge pull request !713 from 刘立伟/master
2023-04-23 06:57:17 +00:00
4661edf7f0 !712 修复路由跳转被阻止时vue-router内部产生报错信息问题
Merge pull request !712 from 爱吃猫的鱼/master
2023-04-23 06:55:46 +00:00
8485605145 !710 修复代码生成表字段注释不全问题
Merge pull request !710 from zouhuu/dev
2023-04-23 06:54:34 +00:00
a4fe88ca61 !707 恢复翻页/切换路由滚动功能
Merge pull request !707 from 也曾为你像超人/master
2023-04-23 06:53:45 +00:00
af15a3b274 !704 Vue的DictTag组件,当value没有匹配的值时,展示value
Merge pull request !704 from Aurora/master
2023-04-23 06:53:11 +00:00
571393c32c 缓存列表:多次清除操作,提示不变的问题; 2023-04-20 15:18:17 +08:00
eff06c110f 修复路由跳转被阻止时vue-router内部产生报错信息问题 2023-04-20 15:02:38 +08:00
6a18e06339 去除element滚动条 2023-04-17 18:52:46 +08:00
f04ca57f7a update ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml.
修复生成列字段注释显示不全问题

Signed-off-by: zouhuu <zouhugz@163.com>
2023-04-17 08:08:44 +00:00
b4f2a4f7dd 恢复翻页/切换路由滚动功能 2023-04-15 17:01:18 +08:00
de0a43285f update pom.xml.
去除多余代码

Signed-off-by: zouhuu <zouhugz@163.com>
2023-04-14 07:31:50 +00:00
4952ac0a3d 修改DictTag组件,当value没有匹配的值时,展示value 2023-04-12 15:14:09 +08:00
6ad345331d 修复开启TopNav后一级菜单路由参数设置无效问题(I6T1DK) 2023-04-11 16:51:55 +08:00
5a634a4ecd 修复导入用户时无法更新存在用户数据的问题 2023-04-10 18:03:34 +08:00
f5b865a2e1 优化用户导入更新时需获取用户编号问题 2023-04-10 17:58:03 +08:00
f7595e4998 !700 newInstance() 已弃用,使用clazz.getDeclaredConstructor().newInstance()
Merge pull request !700 from Nymph2333/N/A
2023-04-10 09:32:01 +00:00
64e71302e4 !699 修改注释中不存在的参数 set
Merge pull request !699 from bell/N/A
2023-04-10 09:26:01 +00:00
2e99c68ed0 !695 下拉图标选择组件优化:1.已选择图标高亮回显 2.滚动条采用el-scrollbar
Merge pull request !695 from 绿色心情/icon-select
2023-04-10 09:09:43 +00:00
af0e0a110e newInstance() 已弃用,使用clazz.getDeclaredConstructor().newInstance()
This method propagates any exception thrown by the nullary constructor, including a checked exception. Use of this method effectively bypasses the compile-time exception checking that would otherwise be performed by the compiler. The Constructor.newInstance method avoids this problem by wrapping any exception thrown by the constructor in a (checked) InvocationTargetException.
The call
 clazz.newInstance()
can be replaced by
 clazz.getDeclaredConstructor().newInstance()
The latter sequence of calls is inferred to be able to throw the additional exception types InvocationTargetException and NoSuchMethodException. Both of these exception types are subclasses of ReflectiveOperationException.

Signed-off-by: Nymph2333 <498092988@qq.com>
2023-04-10 06:27:40 +00:00
bef86e041f 修改注释中不存在的参数 set
Signed-off-by: bell <bellaconly@qq.com>
2023-04-10 03:20:19 +00:00
1067567f1c 下拉图标选择组件优化:1.已选择图标高亮回显 2.滚动条采用el-scrollbar 2023-04-09 13:20:59 +08:00
e
0a670fdfd7 将el-scrollbar移动到main-container下,避免鼠标移出时无法隐藏的问题 2023-04-08 04:47:34 +08:00
a33090c90e 添加新群号:101046199 2023-04-05 17:52:27 +08:00
5061558e94 优化固定头部页签滚动条被隐藏的问题 2023-04-05 17:50:32 +08:00
e7f088552f !686 导出Excel,提高导出效率
Merge pull request !686 from wzy1024/wzy1024
2023-04-05 09:36:45 +00:00
5c4682e060 !683 修复tab栏“关闭其他”异常的问题
Merge pull request !683 from 也曾为你像超人/N/A
2023-04-05 09:35:24 +00:00
5d5ebbec1a !682 解决表字段comment过长问题
Merge pull request !682 from baozhigang/column-comment
2023-04-05 09:35:04 +00:00
23544bab5e !681 移除vue-multiselect样式
Merge pull request !681 from Jimi/master
2023-04-05 09:34:17 +00:00
c5ef0336a4 !676 优化选择图标组件
Merge pull request !676 from 也曾为你像超人/master
2023-04-05 09:30:43 +00:00
a907f8485c 导出Excel,@Excel注解使用dictType属性时,如果有大量的字典数据,就会有大量的查询redis(打开、关闭),导致特别慢。于是使用map存储字典数据,相同的key就不需要再次去查询redis,大大提高了导出效率。 2023-04-04 11:58:26 +08:00
66200c4203 修复tab栏”关闭其他“异常的问题
Signed-off-by: 也曾为你像超人 <1553592282@qq.com>
2023-04-01 03:17:47 +00:00
5a25212509 解决表字段comment过长问题 2023-03-30 20:10:22 +08:00
95742bf5bd style:移除vue-multiselect样式(项目中并未安装vue-multiselect plugin) 2023-03-30 14:58:06 +08:00
4eea8cdbb0 优化选择图标组件 2023-03-18 10:59:05 +08:00
cfce89be7d 升级fastjson到最新版2.0.25 2023-03-18 10:30:34 +08:00
ce7e12ec1d delete build style 2023-03-18 09:31:26 +08:00
4f02f3c6f7 支持自定义隐藏属性列过滤子对象(I6GKPE) 2023-03-17 14:13:39 +08:00
5ca9bd6876 !673 $tab.closePage后存在非首页页签时不应该跳转首页
Merge pull request !673 from Giovanni/master
2023-03-17 06:11:24 +00:00
020a2d4670 !671 优化弹窗后导航栏偏移的问题
Merge pull request !671 from 也曾为你像超人/master
2023-03-17 06:08:47 +00:00
635d621b7b !670 修复页面切换时布局错乱的问题
Merge pull request !670 from 也曾为你像超人/N/A
2023-03-17 05:53:51 +00:00
4cbd56cbd7 !669 用户多角色,数据权限切面处理时可能出现权限抬升的情况。
Merge pull request !669 from 0慕容雪0/master
2023-03-17 05:50:26 +00:00
dcb9cb3d13 优化弹窗后导航栏偏移的问题 2023-03-11 14:42:02 +08:00
628bc94a9a update ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java.
Signed-off-by: 0慕容雪0 <ytu.mxh@163.com>
2023-03-11 04:31:55 +00:00
38ddefe2e6 修复页面切换时布局错乱的问题
Signed-off-by: 也曾为你像超人 <1553592282@qq.com>
2023-03-11 02:19:57 +00:00
7a090bda1e 关闭当前tab页应跳转最右侧tab页而非首页 2023-03-10 18:04:56 +08:00
4e8dd706d5 update ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java.
DataScopeAspect,数据权限切面处理类中,用户多角色情况下,若所有角色都不包含传递过来的权限字符,这个时候sqlString也会为空,会导致用户拥有全部数据权限,所以要限制一下, 可以根据conditions集合是否为空,来判断循环时所有角色是否都是在判断权限字符时continue了。
复现方法: 在使用@DataScope注解时permission定义了值,这个值所有角色不包含。

Signed-off-by: 0慕容雪0 <ytu.mxh@163.com>
2023-03-10 08:22:35 +00:00
641e550d7f 优化修改密码日志存储明文问题(I6ESO9) 2023-03-05 12:06:27 +08:00
81a01a1d9d 优化文件下载出现的异常(I6DLNU) 2023-02-28 13:33:12 +08:00
6523fe59a2 日志管理使用索引提升查询性能 2023-02-23 10:01:16 +08:00
90970eb9fe 修复isMatchedIp的参数判断产生空指针的问题 2023-02-22 10:29:28 +08:00
3402b69556 移除apache/commons-fileupload依赖 2023-02-21 18:06:28 +08:00
2c5e3e429f 升级druid到最新版本1.2.16 2023-02-21 18:05:22 +08:00
96ba768f50 优化代码 2023-02-21 18:02:00 +08:00
1268637e58 支持登录IP黑名单限制 2023-02-21 09:00:44 +08:00
61caa7966b 日志注解支持排除指定的请求参数 2023-02-20 16:25:40 +08:00
a5f95eddab 新增监控页面图标显示 2023-02-17 08:55:22 +08:00
ade70583e9 操作日志新增消耗时间属性 2023-02-16 10:22:39 +08:00
5676cf9ad4 修复匿名注解Anonymous空指针问题(I683DT) 2023-02-06 11:20:12 +08:00
c3d0cd5f8c update copyright 2023 2023-02-04 22:26:02 +08:00
eb96afee64 连接池Druid支持新的配置connectTimeout和socketTimeout 2023-02-04 22:25:49 +08:00
5873da87ae 屏蔽定时任务bean违规的字符 2023-02-04 22:25:33 +08:00
4f1933e2e4 !656 tagsView右键选择框,只存在首页时,不应该存在关闭左侧选项
Merge pull request !656 from Giovanni/master
2023-02-04 14:21:28 +00:00
9926f73cd0 tagsView右选框,首页不应该存在关闭左侧选项 2023-02-01 15:58:40 +08:00
492919d4af 升级element-ui到最新版本2.15.12 2023-01-19 12:05:01 +08:00
a7ff50e695 升级fastjson到最新版2.0.23 2023-01-19 12:04:11 +08:00
71e7e1d6dd 字符未使用下划线不进行驼峰式处理 2023-01-19 12:02:48 +08:00
5073f95ccd 添加新群号:108482800 2023-01-11 12:55:29 +08:00
c3a727b2fd 若依 3.8.5 2023-01-01 09:09:25 +08:00
19eaad0129 v3最新版本不需要render-after-expand 2022-12-23 16:08:23 +08:00
565cbb8c7a 升级pagehelper到最新版1.4.6 2022-12-13 19:42:39 +08:00
b2cf949956 修改参数键名时移除前缓存配置 2022-12-13 19:40:48 +08:00
3fec133c69 升级oshi到最新版本6.4.0 2022-12-13 19:39:36 +08:00
c9de6fcd82 优化代码 2022-12-13 19:39:19 +08:00
22ee2c2e94 删除fuse无效选项maxPatternLength 2022-12-08 10:21:48 +08:00
f11db02ff8 修复代码生成图片/文件/单选时选择必填无法校验问题(I64IO2) 2022-12-08 10:19:38 +08:00
d5f5c5d066 升级fastjson到最新版2.0.20 2022-12-08 10:13:39 +08:00
4536906b21 修复Vue3树形下拉不能默认选中(I64ESN) 2022-12-07 20:24:08 +08:00
9748e10339 升级druid到最新版本1.2.15 2022-12-07 11:41:44 +08:00
b08a6ce3f6 升级kaptcha到最新版2.3.3 2022-12-07 10:45:50 +08:00
3039b745a9 升级echarts到最新版本5.4.0 2022-12-07 10:12:15 +08:00
39298d803c 添加新群号:170801498 2022-12-03 12:50:26 +08:00
09bb3e15c6 定时任务违规的字符 2022-12-03 12:48:51 +08:00
3b8a68c4cf 升级oshi到最新版本6.3.2 2022-12-03 12:43:37 +08:00
9aae863ce3 优化弹窗内容过多展示不全问题(I645RU) 2022-12-03 12:42:50 +08:00
963247df43 !627 update ruoyi-ui/src/plugins/download.js.
Merge pull request !627 from Zeno/N/A
2022-12-01 08:21:29 +00:00
7d874e31cf update ruoyi-ui/src/plugins/download.js.
修复文件名包含特殊字符(+、-、*...)的文件无法下载问题

Signed-off-by: Zeno <15270656234@163.com>
2022-11-28 10:29:38 +00:00
1bb6342bcb 修复Log注解GET请求记录不到参数问题 2022-11-22 10:41:40 +08:00
27acbe5b73 修复某些特性的环境生成代码变乱码TXT文件问题 2022-11-22 09:23:17 +08:00
6474a17100 消除Vue3控制台出现的警告信息 2022-11-21 19:10:25 +08:00
142f6ad6a0 兼容Excel下拉框内容过多无法显示的问题(I5XB6I) 2022-11-21 12:20:36 +08:00
b4bdd4f306 开启TopNav没有子菜单隐藏侧边栏 2022-11-17 14:27:30 +08:00
74ba681fee 修复回显数据字典数组异常问题(I60UYQ) 2022-11-15 14:11:52 +08:00
8f2b3ac465 !611 修复调度日志点击多次数据不变化的问题
Merge pull request !611 from 也曾为你像超人/N/A
2022-11-15 06:09:02 +00:00
7eee3b9f02 升级druid到最新版本1.2.14 2022-11-14 11:17:04 +08:00
27e34c2f0a 忽略不必要的属性数据返回 2022-11-12 11:26:48 +08:00
836180fe0e 优化导出对象的子列表为空会出现[]问题 2022-11-11 11:31:27 +08:00
06fbda5324 修复sheet超出最大行数异常问题 2022-11-07 11:20:02 +08:00
bf313b17da !612 根据调度编号获取详细信息参数名改正
Merge pull request !612 from Rain/N/A
2022-10-31 05:51:48 +00:00
a8b9485a29 根据调度编号获取详细信息参数名改正
Signed-off-by: Rain <938448486@qq.com>
2022-10-31 05:51:08 +00:00
101e15d83f 修复调度日志点击多次数据不变化的问题
Signed-off-by: 也曾为你像超人 <1553592282@qq.com>
2022-10-31 05:45:21 +00:00
ebb9f15a75 新增返回警告消息提示 2022-10-30 12:02:06 +08:00
cd137bd9fc 升级fastjson到最新版2.0.16 2022-10-30 09:58:12 +08:00
07bde5f88a !610 pagehelper-boot更新1.4.5
Merge pull request !610 from abbfun/N/A
2022-10-30 01:57:27 +00:00
6fffa02acf pagehelper-boot更新1.4.5
Signed-off-by: abbfun <819589789@qq.com>
2022-10-29 14:45:55 +00:00
dc48f9858b 修复table中更多按钮切换主题色未生效修复问题 2022-10-28 20:59:42 +08:00
a6b2ac5dcd 升级oshi到最新版本6.3.0 2022-10-28 19:57:35 +08:00
c0685b7f7f !608 编辑头像时生成为透明png图片
Merge pull request !608 from BlossomWave/N/A
2022-10-28 11:48:22 +00:00
fb2d616c57 !609 优化代码
Merge pull request !609 from lihy2021/N/A
2022-10-28 11:44:27 +00:00
6ff6853082 !606 重置时取消部门选中
Merge pull request !606 from 也曾为你像超人/N/A
2022-10-28 11:42:26 +00:00
f8014ae969 !602 去除某些svg图标的fill="#bfbfbf"属性,避免菜单激活无法修改其填充颜色
Merge pull request !602 from 清溪先生/master
2022-10-28 11:39:13 +00:00
1de2b7a57e 优化代码 2022-10-27 01:25:39 +00:00
f01aa37394 update ruoyi-ui/src/views/system/user/profile/userAvatar.vue.
默认修改头像时如果上传的图片为png透明图片,生成的头像透明部分会变成黑色,修改了生成头像为png格式。可正常显示图片透明部分。

Signed-off-by: BlossomWave <316975215@qq.com>
2022-10-24 08:25:33 +00:00
4517dea98d 重置时取消部门选中
Signed-off-by: 也曾为你、像超人 <1553592282@qq.com>
2022-10-21 23:24:35 +00:00
e21396870f 修正菜单状态注释信息 2022-10-21 11:56:15 +08:00
b67f6a0fec !604 修复小屏幕上修改头像界面布局错位的问题
Merge pull request !604 from 也曾为你、像超人/master
2022-10-21 03:50:16 +00:00
42d8104505 !603 update ruoyi-ui/src/views/system/user/index.vue.
Merge pull request !603 from kknd97/N/A
2022-10-21 03:46:49 +00:00
f40a0eab23 !601 swagger-ui静态资源缓存
Merge pull request !601 from abbfun/N/A
2022-10-21 03:41:22 +00:00
b6153d1aef 修正选择按钮宽度 2022-10-21 11:21:59 +08:00
a2c585daa4 !605 升级fastjson到最新版2.0.15
Merge pull request !605 from Rain/N/A
2022-10-21 03:11:58 +00:00
5a60bf0b0a 升级fastjson到最新版2.0.15
Signed-off-by: Rain <938448486@qq.com>
2022-10-21 03:01:54 +00:00
9dcddc7876 修复小屏幕上修改头像界面布局错位的问题 2022-10-20 19:18:10 +08:00
b970185536 update ruoyi-ui/src/views/system/user/index.vue.
handleUpdate(row)方法中:this.form = response.data;语句
会导致【this.form.postIds = response.postIds;】和【this.form.roleIds = response.roleIds;】失效。
导致用户编辑对话框中,角色和部门多选框无法正常修改。
建议使用以下语句修改:
this.$set(this.form, "postIds", response.postIds);
this.$set(this.form, "roleIds", response.roleIds);

Signed-off-by: kknd97 <liujingwei@ln.chinamobile.com>
2022-10-20 06:27:02 +00:00
a64a029323 去除某些svg图标的fill="#bfbfbf"属性,避免菜单激活无法修改其填充颜色。
Signed-off-by: 清溪先生 <usfree2021@163.com>
2022-10-19 22:11:14 +08:00
78f4d1c85b swagger-ui静态资源缓存
Signed-off-by: abbfun <819589789@qq.com>
2022-10-19 09:07:35 +00:00
bf83fe568b 修复主题颜色在Drawer组件不会加载问题(I5VCF0) 2022-10-19 10:54:01 +08:00
6505432bf4 修复文件上传组件格式验证问题(I5V32H) 2022-10-12 19:33:58 +08:00
a32a931d24 升级core-js到最新版本3.25.3 2022-10-10 09:22:47 +08:00
4d72fb4289 R isError and isSuccess static 2022-10-10 09:22:37 +08:00
186c04d90a !595 解决导出时包含空子列表数据异常的问题
Merge pull request !595 from 也曾为你、像超人/N/A
2022-10-10 01:20:41 +00:00
c542b7ac32 解决导出时包含空子列表数据异常的问题
Signed-off-by: 也曾为你、像超人 <1553592282@qq.com>
2022-09-30 23:06:10 +00:00
3607e008a3 优化限流打印日志KEY(I5SQ09) 2022-09-28 19:32:55 +08:00
5b8edbf381 修复代码生成勾选属性无效问题 2022-09-28 19:31:52 +08:00
03f7bc0f3f 导入更新用户数据前校验数据权限 2022-09-28 19:26:16 +08:00
e95a1245c5 若依 3.8.4 2022-09-26 08:29:03 +08:00
d7441edae7 升级core-js到最新版本3.25.2 2022-09-22 11:13:49 +08:00
5053361a7f 升级fastjson到最新版2.0.14 2022-09-22 11:13:32 +08:00
acbdd6365a !581 优化日志操作中重置按钮时重复查询的问题
Merge pull request !581 from 也曾为你、像超人/N/A
2022-09-19 06:41:36 +00:00
e781f88eca 优化日志操作中重置按钮时重复查询的问题
Signed-off-by: 也曾为你、像超人 <1553592282@qq.com>
2022-09-19 06:30:47 +00:00
86d16d070d 通用下载方法新增config配置选项(I5PNXE) 2022-09-19 13:09:21 +08:00
854b405d89 修改用户登录账号重复验证 2022-09-18 11:26:03 +08:00
c3faa1a925 升级element-ui到最新版本2.15.10 2022-09-15 08:48:43 +08:00
37d6cc8146 优化代码生成同步后值NULL问题(I5OJDW) 2022-09-13 08:23:30 +08:00
2293822dc2 优化没有权限的用户编辑部门缺少数据(I5OF3O) 2022-09-12 17:22:23 +08:00
f5bec70911 R add isError and isSuccess method 2022-09-12 17:22:07 +08:00
87c53a049b !574 修复 issue#I5Q2ZO
Merge pull request !574 from 捏造的信仰/fix-I5Q2ZO
2022-09-09 01:45:12 +00:00
5bcd2825b6 !568 style重复赋值
Merge pull request !568 from coverme/N/A
2022-09-09 01:25:22 +00:00
036144b9ea 插入 SysOperLog 时,限制 operUrl 属性的长度
Signed-off-by: 捏造的信仰 <yiding.he@gmail.com>
2022-09-07 03:00:51 +00:00
42d602b7a8 添加新群号:160110482 2022-08-28 20:09:25 +08:00
d4b800036c style重复赋值
Signed-off-by: 胡亚飞 <huyafeily@aliyun.com>
2022-08-26 16:26:09 +00:00
2f380f0c41 !564 修复执行任务时,若方法入口在任务的父类,则无法执行的问题
Merge pull request !564 from 捏造的信仰/fix-issue-I5NNXI
2022-08-26 00:42:03 +00:00
39efed1710 修复多文件上传报错出现的异常问题 2022-08-24 11:18:52 +08:00
9a895763d5 优化页面内嵌iframe切换tab不刷新数据 2022-08-23 20:59:26 +08:00
7347cbaedf 优化页面内嵌iframe切换tab不刷新数据 2022-08-23 17:29:09 +08:00
a78b5b7b2a 修复执行任务时,若方法入口在任务的父类,则无法执行的问题
实际项目开发中,可能会为所有定时任务类建一个共同的父类,任务的执行入口在父类定义,以便管理。此时使用 `getDeclaredMethod()` 是无法从子类找到要执行的方法的,而是要换用 `getMethod()` 方法。

Signed-off-by: 捏造的信仰 <yiding.he@gmail.com>
2022-08-23 05:36:29 +00:00
99d1760b98 优化代码 2022-08-22 15:27:58 +08:00
4d71cfa90a !562 修复菜单管理已知问题
Merge pull request !562 from 稚屿/N/A
2022-08-22 06:20:18 +00:00
e02f692359 修复菜单管理已知问题
问题描述:在菜单管理下,类型为菜单或者按钮的条目下点击修改按钮。
情况1,如果是类型为菜单,第一次点击修改按钮正常,则第二次点击另一个条目后面的修改按钮时报错!
情况2,如果是类型为按钮,第一次点击修改时正常,当点击取消按钮关闭弹窗时,浏览器报错!

报错代码:this.resetForm("form")

修复方案:添加遗漏的表单 prop 属性

Signed-off-by: 稚屿 <1491182878@qq.com>
2022-08-22 06:19:08 +00:00
77ec8d1c9a 修复代码生成权限父编号错误(I5NATP) 2022-08-22 12:21:07 +08:00
66ce21ec29 升级fastjson到最新版2.0.12 2022-08-22 12:04:01 +08:00
27e0937235 支持多权限字符匹配角色数据权限 2022-08-22 12:03:51 +08:00
aadb7a41cb 优化Context信息,防止泄漏问题 2022-08-22 10:24:20 +08:00
9b3767a954 优化多角色数据权限匹配规则 2022-08-21 22:53:57 +08:00
851dc54b49 修复图片预览组件src属性为null值控制台报错问题(I5KBAS) 2022-08-15 12:07:24 +08:00
cf2c4e02c6 字典管理操作类型新增其他 2022-08-14 09:40:36 +08:00
88b5715eae 升级oshi到最新版本6.2.2 2022-08-12 12:17:48 +08:00
5b05d4a123 个人中心修改密码去除多余的user传递 2022-08-12 12:17:28 +08:00
893ef39401 防止用户个人信息修改部门 2022-08-12 12:16:30 +08:00
890ad682d7 优化修改资料头像被覆盖的问题(I5LK04) 2022-08-11 13:22:55 +08:00
b9f45057b8 操作日志记录支持排除敏感属性字段 2022-08-10 18:01:02 +08:00
89008c28df 升级fastjson到最新版2.0.11 2022-08-10 14:03:35 +08:00
af7d0a3409 优化导出对象的子列表判断条件 2022-08-10 13:59:57 +08:00
1cd2eef899 优化excel/scale属性导出单元格数值类型 2022-08-09 08:02:24 +08:00
8c7b93ec4f !547 fix: 账户解锁接口去掉多余的 /
Merge pull request !547 from iacker/N/A
2022-08-08 23:44:57 +00:00
3f7bf545b5 fix: 账户解锁接口去掉多余的 / 2022-08-08 13:55:08 +00:00
cbedec7ca6 登录日志新增解锁账户功能 2022-08-08 09:23:52 +08:00
fb1bac2114 新增删除Hash中的某条数据 2022-08-07 19:31:04 +08:00
d0f399a66a 优化xss过滤后格式出现的异常 2022-08-07 19:30:54 +08:00
e73dbd470a Excel注解支持导出对象的子列表方法 2022-08-07 18:33:04 +08:00
e0cd5381e2 数据逻辑删除不进行唯一验证 2022-08-03 16:48:55 +08:00
aee5d417ed 支持配置密码最大错误次数/锁定时间 2022-07-30 14:01:38 +08:00
250c5ba226 优化任务过期不执行调度 2022-07-29 20:28:59 +08:00
b91c848962 !538 优化表格上右侧工具条(搜索按钮显隐&右侧样式凸出)
Merge pull request !538 from abbfun/N/A
2022-07-29 12:28:38 +00:00
d4475d0e8d 优化表格上右侧工具条(搜索按钮显隐&右侧样式凸出)
无搜索条件时可通过search隐藏搜索按钮,工具条组右侧样式超出5px(相对于底部表格),其父节点gutter代码生成默认10,此处也默认10,使工具组样式左右一致
2022-07-27 09:05:31 +00:00
aff54ab5fe 自定义数据权限不排除重复 2022-07-26 20:02:17 +08:00
06177addf5 添加新群号:104748341 2022-07-25 18:45:51 +08:00
9f3b91fe57 !535 所有的覆写方法,必须加@Override注解
Merge pull request !535 from 天才的逻辑/master
2022-07-25 10:32:48 +00:00
80d25863db !536 防止主键字段名与'row'或'ids'一致导致报错的问题。
Merge pull request !536 from 张政/N/A
2022-07-25 10:32:42 +00:00
cf8a7f8678 防止主键字段名与'row'或'ids'一致导致报错的问题。 2022-07-23 08:29:52 +00:00
86fc709b03 升级pagehelper到最新版1.4.3 2022-07-22 14:54:38 +08:00
b8b58cb202 所有的覆写方法,必须加@Override注解 2022-07-22 10:57:00 +08:00
96970ff951 所有的覆写方法,必须加@Override注解 2022-07-22 10:35:31 +08:00
7cc9d17424 支持自定义隐藏Excel属性列 2022-07-21 13:52:05 +08:00
bc8b5f1079 优化布局设置使用el-drawer抽屉显示 2022-07-21 08:50:48 +08:00
5ec5e1a65d 优化字典数据使用store存取 2022-07-20 19:38:16 +08:00
1f0e742710 Excel注解支持backgroundColor属性设置背景色 2022-07-20 09:39:58 +08:00
28b9fbb4d2 优化多个相同角色数据导致权限SQL重复问题 2022-07-19 15:55:03 +08:00
2c79dc906e 升级oshi到最新版本6.2.1 2022-07-14 19:49:32 +08:00
1852017ecc 修改验证码开关变量名 2022-07-14 19:49:00 +08:00
424d11896a !531 去除生成验证码多余的逻辑判断
Merge pull request !531 from 稚屿/N/A
2022-07-14 09:28:46 +00:00
edefee46b2 去除生成验证码多余的逻辑判断 2022-07-13 01:00:44 +00:00
c7c3da2038 升级fastjson到最新版2.0.9 2022-07-12 18:07:05 +08:00
eb9f3d3772 修改验证码开关变量名 2022-07-12 18:04:49 +08:00
1a61790407 !523 修改错误的变量名
Merge pull request !523 from SG/N/A
2022-07-12 10:02:50 +00:00
fe98fba5b5 !527 调增数组格式声明,random随机转换修正
Merge pull request !527 from 靖少毅/jsy20220705
2022-07-12 10:01:56 +00:00
4eb8809a8a 调增数组格式声明,random随机转换修正 2022-07-05 16:43:55 +08:00
0a893d196e update 优化魔法值 2022-07-05 02:06:31 +00:00
SG
ec45cf04af 修改错误的变量名 2022-07-01 13:56:44 +00:00
6f48fc3c58 若依 3.8.3 2022-06-27 08:23:47 +08:00
8558954da7 !516 修复缓存列表页面变量名错误导致错误
Merge pull request !516 from zbk/N/A
2022-06-27 00:10:17 +00:00
zbk
2ae41df23b 修复缓存列表页面变量名错误导致错误 2022-06-26 12:51:55 +00:00
47b8daf69c 字典类型删除多余的mapper注解 2022-06-26 13:10:44 +08:00
ef31a0de42 升级fastjson到最新版2.0.8 2022-06-26 10:37:45 +08:00
8c956d681b 默认不启用压缩文件缓存防止node_modules过大 2022-06-26 08:53:56 +08:00
89eb44afbc 优化字典数据回显样式下拉框显示值 2022-06-26 08:53:15 +08:00
9d7e32fb07 新增缓存列表菜单功能 2022-06-25 09:39:39 +08:00
abb88d622a 调整响应成功状态码与全局保持一致 2022-06-24 09:22:05 +08:00
1ccdd75019 !515 调整响应成功状态码为200,与全局保持一致
Merge pull request !515 from 武玉航/master
2022-06-24 01:16:59 +00:00
aaedafff52 调整响应成功状态码为200,与全局保持一致 2022-06-23 14:42:10 +08:00
3ccf5c0e50 新增内容编码/解码方便插件集成使用 2022-06-22 17:57:33 +08:00
db5fea922f 升级fastjson到最新版2.0.7 2022-06-15 17:08:29 +08:00
0214d93299 删除多余的salt字段 2022-06-15 17:08:06 +08:00
1124a203cc 升级druid到最新版本1.2.11 2022-06-14 21:29:06 +08:00
e8fbf5fdbd reset babel 2022-06-14 21:26:14 +08:00
8fd4ae1282 优化druid开启wall过滤器出现的异常问题 2022-06-13 21:43:31 +08:00
eab1b450d5 优化代码 2022-06-13 21:43:11 +08:00
98fc30786e !504 update 优化新增用户与角色信息、用户与岗位信息逻辑
Merge pull request !504 from 疯狂的狮子Li/N/A
2022-06-13 13:26:04 +00:00
a46c4bf04e update 优化新增用户与角色信息、用户与岗位信息逻辑 2022-06-08 13:53:08 +00:00
b97a662f2e 新增Anonymous匿名访问不鉴权注解 2022-05-28 09:34:05 +08:00
9639c096ba 用户列表查询不显示密码字段 2022-05-27 17:50:49 +08:00
e4af41e89a !497 增加对空字符串参数的过滤
Merge pull request !497 from root/master
2022-05-27 08:53:42 +00:00
52e1717014 增加对空字符串参数的过滤 2022-05-27 12:06:27 +08:00
8a2e3d13f2 表单构建按钮不显示正则校验 2022-05-27 09:18:26 +08:00
a29a0648ad 升级spring-boot到最新版本2.5.14 2022-05-27 08:37:34 +08:00
63d471ec94 修复字典导出序列化报错问题 2022-05-27 08:37:14 +08:00
9fa3eac3aa 升级fastjson到最新版2.0.4 2022-05-26 09:02:32 +08:00
e320c50e49 !492 fastjson 版本升级
Merge pull request !492 from abbfun/N/A
2022-05-24 01:54:24 +00:00
524ad4e6dd fastjson 版本升级
fastjson <= 1.2.80 存在反序列化任意代码执行漏洞
2022-05-23 07:36:18 +00:00
77fffda10e 添加新群号:139821253 2022-05-23 09:38:52 +08:00
da0309eb09 用户头像上传限制只能为图片格式 2022-05-22 18:21:26 +08:00
6805a96e53 接口使用泛型使其看到响应属性字段 2022-05-20 16:25:51 +08:00
a92667c000 新增获取配置文件中的属性值方法 2022-05-20 16:23:52 +08:00
4a0619cadb 优化switch case条件 2022-05-20 16:23:36 +08:00
a7e16d582d !488 修复操作日志列表查询业务类型时的bug
Merge pull request !488 from 也曾为你、像超人/N/A
2022-05-20 07:56:27 +00:00
b5b8d941f3 update ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml.
问题:查业务类型为其他(businessType = 0)的数据时,会查到所有数据

原因:当参数为 Integer 类型 0 时,MyBatis 会把 0 当做空字符串处理
2022-05-17 02:08:37 +00:00
9c3b53b701 用户管理左侧树型组件增加选中高亮保持 2022-05-13 15:02:16 +08:00
5693bbe1f5 升级oshi到最新版本6.1.6 2022-05-11 09:58:25 +08:00
0055f479cb 修复字典数据显示不全问题(I55MR3) 2022-05-09 20:27:09 +08:00
1c41b701dd 优化excel创建表格样式 2022-05-09 17:37:33 +08:00
9476f7f616 升级spring-boot到最新版本2.5.13 2022-05-01 20:22:35 +08:00
cbe405f6ea ui code format 2022-05-01 20:22:25 +08:00
7414bc492e 修改代码生成树选择组件 2022-04-25 10:27:06 +08:00
6f14087a16 修改显示顺序orderNum类型为整型 2022-04-25 10:23:47 +08:00
328d4b916d Excel注解支持color字体颜色 2022-04-23 20:53:16 +08:00
b42a8176ca 设置分页参数默认值 2022-04-17 10:29:12 +08:00
2a9beec31d 检查定时任务bean所在包名是否为白名单配置 2022-04-16 22:06:25 +08:00
910fe6261b 新增获取不带后缀文件名称方法 2022-04-16 22:06:15 +08:00
0c820b96d8 !471 新增一个取文件名而不带后缀的整合方法,干净又卫生啊兄弟们
Merge pull request !471 from XCSDN/N/A
2022-04-16 13:53:10 +00:00
c3c49a05c2 新增一个取文件名而不带后缀的整合方法,干净又卫生啊兄弟们 2022-04-16 06:02:07 +00:00
68a616d7c7 升级element-ui到最新版本2.15.8 2022-04-15 09:32:21 +08:00
a0447de061 字典类型必须以字母开头,且只能为(小写字母,数字,下滑线) 2022-04-15 09:31:51 +08:00
46db06a22b !465 update ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java.
Merge pull request !465 from XCSDN/N/A
2022-04-15 01:17:21 +00:00
de5ae4a05e 添加页签openPage支持传递参数 2022-04-08 15:42:10 +08:00
c0d430f4e5 update ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java.
字典类型必须以字母开头,且字典类型只能由小写字母或加下划线还有数字组成
防止由于字典类型不符合前端开发规范而报错
2022-04-07 04:57:56 +00:00
d910888181 代码生成树表新增(展开/折叠) 2022-04-07 10:56:40 +08:00
db2dfee6ae 用户缓存信息添加部门ancestors祖级列表 2022-04-07 09:50:42 +08:00
d311d56bbf 修复Excel注解prompt/combo同时使用不生效问题 2022-04-03 18:28:30 +08:00
3bc5ef38d3 升级spring-boot到最新版本2.5.12 防止RCE漏洞 2022-04-02 10:16:09 +08:00
bac3b3a0dc 降级jsencrypt版本兼容IE浏览器 2022-04-02 10:15:25 +08:00
07fded4da9 update readme 2022-04-02 10:13:58 +08:00
a854e0ca8e 若依 3.8.2 2022-04-01 08:30:48 +08:00
de1766abde 新增清理分页的线程变量方法 2022-03-31 11:48:27 +08:00
01a566c794 升级spring-boot到最新版本2.5.11 2022-03-30 10:40:07 +08:00
5362a633e6 升级fastjson到最新版1.2.80 2022-03-30 10:39:47 +08:00
b2c3f45141 update registry source 2022-03-30 10:39:09 +08:00
d5f9b5b74a topNav自定义隐藏侧边栏路由 2022-03-30 10:38:51 +08:00
2043d1f439 优化IP地址获取到多个的问题 2022-03-27 14:36:48 +08:00
61034d4dde 优化导出excel单元格验证,包含变更为开头.防止正常内容被替换 2022-03-27 14:36:31 +08:00
6605bf35a8 reset pr 452 2022-03-26 17:28:58 +08:00
b2b93e5060 !457 修改RedisCache方法形参命名
Merge pull request !457 from lu_ming/master
2022-03-26 09:25:05 +00:00
098286fcaf 修改RedisCache方法形参命名 2022-03-25 18:50:51 +08:00
eaa12de740 添加新群号:167385320 2022-03-22 16:47:56 +08:00
857054179c 优化固定Header后顶部导航栏样式问题(I4XDN5) 2022-03-17 09:42:39 +08:00
0a3fcfd9f4 !453 update ruoyi-ui/src/store/modules/user.js.
Merge pull request !453 from guxin0123/N/A
2022-03-16 05:19:33 +00:00
0271aa5414 update ruoyi-ui/src/store/modules/user.js.
修复数据库用户表 头像列为 null 时不显示默认头像问题
2022-03-16 04:52:33 +00:00
a0364f0758 优化菜单名称过长悬停显示标题 2022-03-15 14:24:52 +08:00
ed693e89c9 !452 跨域问题
Merge pull request !452 from younger007/master
2022-03-15 06:23:38 +00:00
526957e0ac !447 优化:解决导出数据时,LocalDateTime类型数据导出没数据问题
Merge pull request !447 from 黄严/dev
2022-03-15 06:23:24 +00:00
420a43cdd5 update ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java.
和文件下载那边一样,存在跨域问题
2022-03-14 02:52:29 +00:00
5e8ccda522 日期转换错误,issue地址:https://gitee.com/y_project/RuoYi-Vue/issues/I4X0U7 2022-03-09 14:39:19 +08:00
62fc38078c 修复遗漏的拼写错误 2022-03-09 10:05:39 +08:00
bc4f844cd8 !445 文件上传兼容Weblogic环境
Merge pull request !445 from yaoozu/master
2022-03-09 02:03:50 +00:00
f15f8e3295 文件上传兼容Weblogic环境 2022-03-07 10:44:01 +08:00
6130bebbb3 开启TopNav没有子菜单情况隐藏侧边栏 2022-03-06 09:03:44 +08:00
9f944c043f !444 修改提示
Merge pull request !444 from SG/N/A
2022-03-05 14:11:22 +00:00
092b3214c5 !443 修复代码错误,其他文件也修改下
Merge pull request !443 from SG/N/A
2022-03-05 14:11:17 +00:00
SG
07dfef48be 修改提示 2022-03-05 12:28:44 +00:00
e9571fc2e2 fix 2022-03-05 05:06:39 +00:00
22f7ccc11d 修复导入Excel时字典字段类型为Long转义为空问题 2022-03-05 08:39:52 +08:00
SG
4bd5009ec1 修复代码错误,其他文件也修改下 2022-03-04 14:38:57 +00:00
cb8f5de5af 修复表单清除元素位置未垂直居中问题(I4V27B) 2022-03-04 19:24:28 +08:00
ac030b7275 优化Excel格式化不同类型的日期对象 2022-02-26 09:54:52 +08:00
9370747479 升级spring-boot到最新版本2.5.10 2022-02-26 09:48:17 +08:00
45efd9290e !438 fix: 服务监控中运行参数显示条件错误
Merge pull request !438 from fuzui/fix_args_show_condition
2022-02-26 01:06:48 +00:00
96edba7eec fix: 服务监控中运行参数显示条件错误 2022-02-26 03:20:50 +08:00
927b05713a 组件fileUpload支持多文件同时选择上传 2022-02-25 11:51:29 +08:00
8f23ff7274 !437 解决通用下载接口跨域问题
Merge pull request !437 from 兮陌/master
2022-02-25 03:49:36 +00:00
158e883e47 fix: 修复文件下载跨域问题 2022-02-25 10:40:29 +08:00
e62e8e372c 组件ImageUpload支持多图同时选择上传 2022-02-25 09:08:56 +08:00
bb65cd1976 代码生成子表支持日期/字典配置 2022-02-24 09:28:51 +08:00
1086c00929 !436 优化部门管理页面email字段的表单验证多余的单引号
Merge pull request !436 from lu_ming/master
2022-02-23 12:46:09 +00:00
9aaa9ce8aa 优化部门管理页面email字段的表单验证多余的单引号 2022-02-23 20:00:47 +08:00
cb5a6d29e2 页面若未匹配到字典标签则返回原字典值 2022-02-23 16:55:09 +08:00
4d8bd8805b 优化个人中心页面email字段的表单验证多余的单引号 2022-02-23 16:54:59 +08:00
c8c57b545a 优化菜单关键字导致的插件报错问题 2022-02-22 19:10:34 +08:00
d0f7a317e4 定时任务默认保存到内存中执行 2022-02-22 19:10:21 +08:00
aa9ed2e863 修复分页组件请求两次问题 2022-02-21 15:21:16 +08:00
54c6c4e547 服务监控新增运行参数信息显示 2022-02-20 16:06:33 +08:00
986b48cf36 升级pagehelper到最新版1.4.1 2022-02-20 16:05:04 +08:00
3bb9b03add 升级spring-boot-mybatis到最新版2.2.2 2022-02-20 16:04:40 +08:00
f05aa674ab 升级oshi到最新版本6.1.2 2022-02-20 16:04:25 +08:00
965bdc9986 !431 修改登录超时刷新页面跳转登录页面还提示重新登录问题
Merge pull request !431 from 也曾为你、像超人/master
2022-02-19 09:08:50 +00:00
e793138031 修改登录超时刷新页面跳转登录页面还提示重新登录问题 2022-02-17 17:16:11 +08:00
d734bfc34f 修复分页组件请求两次问题(I4SQOR) 2022-02-17 11:56:11 +08:00
84fe0737de update 更新uuid去除默认值 漏改 2022-02-16 08:53:11 +00:00
81630a096f 代码生成同步保留必填/类型选项 2022-02-13 21:06:28 +08:00
21780d8106 优化代码 2022-02-13 21:06:18 +08:00
b7b4364db2 代码生成编辑修改打开新页签 2022-02-12 13:14:09 +08:00
d9859de756 代码优化 2022-02-12 13:13:04 +08:00
5e6fd0d1e1 !429 修复自定义组件file-upload无法显示第一个文件,列表显示的文件比实际文件少一个的问题
Merge pull request !429 from hjk2008/master
2022-02-12 03:56:02 +00:00
a91d7cdd72 !428 删除方法无返回值时,方法注释上的@return,StringBuilder append() 改为链式调用
Merge pull request !428 from 我的世界有我/master
2022-02-12 03:55:12 +00:00
d00dc3b03a !426 修正单词拼写错误
Merge pull request !426 from 稚屿/master
2022-02-12 03:54:13 +00:00
f5c69bae30 !425 优化默认值的问题,Model中不建议有默认值的逻辑
Merge pull request !425 from Yancey/default_value_optimization
2022-02-12 03:53:29 +00:00
89fe17f419 !424 update .gitignore.
Merge pull request !424 from oo0oo/N/A
2022-02-12 03:53:06 +00:00
sam
c491257359 修复自定义组件file-upload无法显示第一个文件,列表显示的文件比实际文件少一个的问题 2022-02-12 08:46:12 +08:00
dd5e514d92 StringBuilder append方法改为链式调用 2022-02-11 10:06:07 +08:00
2532e40f9c 删除方法无返回值时,方法注释上的@return 2022-02-11 10:05:01 +08:00
50236ae4e5 修复Xss注解字段值为空时的异常问题 2022-02-10 17:17:51 +08:00
c99eb98001 代码优化 2022-02-09 09:10:50 +08:00
a29201a248 修正单词拼写错误 2022-02-09 08:46:54 +08:00
6f0c59d7be 优化默认值的问题,Model中不建议有默认值的逻辑。 2022-02-09 00:27:51 +08:00
a6ed5667ab update .gitignore.
添加JRebel工具rebel.xml文件规则至gitignore
2022-02-01 02:24:49 +00:00
612c4293d1 用户访问控制时校验数据权限,防止越权 2022-01-27 12:05:04 +08:00
8007b22b85 导出Excel时屏蔽公式,防止CSV注入风险 2022-01-27 12:04:40 +08:00
35664d818d update ry.bat 2022-01-27 12:04:21 +08:00
1fe08f49c7 升级spring-boot到最新版本2.5.9 2022-01-23 10:56:41 +08:00
48b007543a fix css class name 2022-01-22 14:05:44 +00:00
dccb3ac6c6 修复选项卡点击右键刷新丢失参数问题 2022-01-18 11:29:31 +08:00
89cd2106ed !416 update ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java.
Merge pull request !416 from SG/N/A
2022-01-18 03:25:31 +00:00
74f991b8c5 !414 优化任务队列满时任务拒绝策略
Merge pull request !414 from root/master
2022-01-18 03:20:23 +00:00
SG
a966b95a5b update ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java.
修正文字
2022-01-14 09:24:15 +00:00
15f05b602f fix ruoyi-vue3下点击编辑,取消修改报错问题 2022-01-14 16:26:03 +08:00
9e51d3f250 优化任务队列满时任务拒绝策略 2022-01-14 11:54:46 +08:00
d7ca248bc8 update copyright 2022 2022-01-14 11:47:25 +08:00
3980b2f2ff 定时任务屏蔽违规的字符 2022-01-14 11:47:14 +08:00
bed9fcea46 优化加载字典缓存数据 2022-01-14 11:46:51 +08:00
b1b82857ba 优化字段更新未同步 2022-01-14 11:46:05 +08:00
869dcf73f8 Vue3前端代码生成模板同步到最新 2022-01-11 17:20:50 +08:00
96a34d1ad7 !409 翻页组件多了一个 :p 导致生成代码无法翻页
Merge pull request !409 from guxin0123/master
2022-01-11 09:17:31 +00:00
766361ac83 update ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm.
翻页组件多了一个 :p 导致生成代码无法翻页
2022-01-11 04:57:26 +00:00
9bd7509e87 添加新群号:264312783 2022-01-11 09:02:16 +08:00
9f7acd4cf9 优化部门修改缩放后出现的错位问题 2022-01-08 09:23:45 +08:00
eb11337f7d 添加遗漏的分页参数合理化属性 2022-01-07 13:09:58 +08:00
d2872539e3 修正文字错误 2022-01-07 13:08:51 +08:00
1a5b024df6 定时任务目标字符串验证包名白名单 2022-01-06 14:50:56 +08:00
578d65dfb4 定时任务目标字符串过滤特殊字符 2022-01-05 14:56:05 +08:00
db4c2d3dd5 代码生成列表图片支持预览 2022-01-04 20:27:08 +08:00
47842a1611 update donate 2022-01-04 20:26:49 +08:00
f4f4cd9b1f Create FUNDING.yml 2022-01-04 19:50:01 +08:00
b7452cc281 update README.md 2022-01-04 10:49:59 +08:00
8ba91fc9dd 优化查询用户详细信息 2022-01-04 09:10:49 +08:00
c8d9b3f8fc 前端支持设置是否需要防止数据重复提交 2022-01-02 10:37:09 +08:00
c9d19cbe56 空值不进行回显数据字典 2022-01-02 10:29:15 +08:00
10ae0bce65 用户修改减少一次角色列表关联查询 2022-01-01 09:50:35 +08:00
7bc15245aa 预览组件支持多图显示 2022-01-01 09:46:18 +08:00
cb6228800b 代码生成新增Java类型Boolean 2022-01-01 09:28:52 +08:00
6ef899d000 修复登录失效后多次请求提示多次弹窗问题 2021-12-31 10:03:54 +08:00
6353f4ff09 若依 3.8.1 2021-12-31 00:00:06 +08:00
bb1af390a7 升级log4j2到2.17.1,防止漏洞风险 2021-12-30 14:41:25 +08:00
f65cd6245d 防重复提交标识组合(key + url + header) 2021-12-30 14:14:40 +08:00
530b2a51d5 修改单词拼写错误 2021-12-30 14:13:38 +08:00
d51e7cbb51 用户管理部门查询选择节点后分页参数初始 2021-12-29 11:04:09 +08:00
f244fe1855 !395 fix https://gitee.com/y_project/RuoYi-Vue/issues/I4O5WD
Merge pull request !395 from 马小法/master
2021-12-29 02:14:26 +00:00
1294f68265 fix https://gitee.com/y_project/RuoYi-Vue/issues/I4O5WD 2021-12-27 15:33:22 +08:00
0e771a6c1b 升级spring-boot到最新版本2.5.8 2021-12-27 12:38:59 +08:00
e4df0c6da1 优化代码生成字典组重复问题 2021-12-24 14:51:33 +08:00
7b23b6db6f 升级oshi到最新版本v5.8.6 2021-12-24 12:00:29 +08:00
be412faf6c 升级fastjson到最新版1.2.79 2021-12-21 13:32:40 +08:00
fd3a699ad8 SQL工具类新增检查关键字方法 2021-12-21 13:32:28 +08:00
c28aa299bd 新增使用Gzip解压缩静态文件地址 2021-12-20 14:25:52 +08:00
a028b566ed 集成compression-webpack-plugin插件实现打包Gzip压缩 2021-12-20 09:46:17 +08:00
ca2405c104 升级log4j2到安全版本,防止漏洞风险 2021-12-19 19:56:53 +08:00
e5647793ce 路由支持单独配置菜单或角色权限 2021-12-18 16:48:31 +08:00
903b5aebca 新增图片预览组件 2021-12-18 12:23:59 +08:00
7492dcc9e6 请求分页方法设置成通用方便灵活调用 2021-12-18 12:22:41 +08:00
8978012f9d 修复打包后字体图标偶现的乱码问题 2021-12-17 11:36:15 +08:00
7cf4a5da87 !391 修改重置表单bug
Merge pull request !391 from 18297093310/jieoschina-master-patch-51652
2021-12-17 03:17:16 +00:00
47b67331d4 修改重置表单bug 2021-12-17 03:06:25 +00:00
6e14601c7c 修复版本差异导致的懒加载报错问题 2021-12-16 16:34:20 +08:00
fef7ead0d5 新增Vue3前端代码生成模板 2021-12-16 09:51:11 +08:00
06aef0587a 用户导入提示溢出则显示滚动条 2021-12-16 09:50:26 +08:00
bf7c259cdd !390 fix: cron组件中周回显bug
Merge pull request !390 from fuzui/fix_week_echo_in_cron_component
2021-12-16 01:45:14 +00:00
43d76e5990 fix: cron组件中周回显bug 2021-12-16 02:18:48 +08:00
d365a52cd6 自定义xss校验注解实现 2021-12-15 10:50:10 +08:00
e1c7115d8c 升级log4j2到安全版本,防止漏洞风险 2021-12-14 12:09:57 +08:00
bb4d75aff0 升级log4j2到安全版本,防止漏洞风险 2021-12-14 10:33:25 +08:00
2743785aaf 修复多参数逗号分隔的问题 2021-12-13 10:11:34 +08:00
2a235917dc 优化下载解析blob异常提示 2021-12-10 10:03:25 +08:00
44ce6774dc 代码生成预览支持复制内容 2021-12-09 09:57:02 +08:00
b911d7f78f 自定义文字复制剪贴指令 2021-12-09 09:56:11 +08:00
4644176e26 升级clipboard到最新版本2.0.8 2021-12-09 09:52:44 +08:00
850b98337b 修正用户分配角色属性错误 2021-12-06 20:58:10 +08:00
7f2921f26b !382 update 优化查询用户的角色组、岗位组代码
Merge pull request !382 from 疯狂的狮子Li/update
2021-12-06 12:35:59 +00:00
836017f2b9 !381 fix 修复主键溢出问题 将查询返回类型改为 Long
Merge pull request !381 from 疯狂的狮子Li/fix
2021-12-06 12:34:52 +00:00
4de4763baf update 优化查询用户的角色组、岗位组代码 2021-12-06 18:32:51 +08:00
965ebd0f03 fix 修复主键溢出问题 将查询返回类型改为 Long 2021-12-03 11:11:43 +08:00
2c3f1c28e5 tomcat update 2021-12-02 16:31:51 +08:00
6bfae2652f 若依 3.8.0 2021-12-01 08:53:11 +08:00
9bc730866f 🎉 RuoYi-Vue3(Vue3 Element Plus Vite)版本 2021-11-30 11:15:33 +08:00
a2d3f987c0 优化代码 2021-11-30 11:15:17 +08:00
bf4ac3ad7a !378 fix: crontab组件bug
Merge pull request !378 from fuzui/fix_cron_tool
2021-11-30 03:03:08 +00:00
f28a91969a fix: crontab组件中规范数据范围、冗余代码去除以及部分通配符说明 2021-11-30 02:08:08 +08:00
ca285f5e53 fix: crontab组件周显示及计算bug 2021-11-30 00:22:23 +08:00
34f2552cad fix: crontab组件互斥bug 2021-11-30 00:17:12 +08:00
89e7cb19b9 注册成功提示类型success 2021-11-26 18:11:57 +08:00
ea71c9b214 !376 camelCase中应该转换下划线,而不是横杠
Merge pull request !376 from khejing/master
2021-11-26 10:07:58 +00:00
e5fd1f76db camelCase中应该是下划线,而不是横杠 2021-11-26 08:26:45 +00:00
664192da0b 升级velocity到最新版本2.3(语法升级) 2021-11-25 15:18:02 +08:00
9fc3e220a7 防止修改用户个人信息接口修改用户名 2021-11-25 14:00:27 +08:00
64f6a69d9a 修复代码生成复选框字典遗漏问题 2021-11-25 13:54:49 +08:00
16734b1d88 升级velocity到最新版本2.3 2021-11-24 15:03:04 +08:00
31106c91fb 修复使用 this.$options.data 报错问题 2021-11-24 15:00:51 +08:00
026a427103 优化前端代码 2021-11-24 14:47:24 +08:00
bafb1372a7 !375 删除代码生成中冗余的导出方法
Merge pull request !375 from fuzui/delete_redundancy_gen_export_function
2021-11-24 00:39:07 +00:00
b4f032fab4 删除代码生成中冗余的导出方法 2021-11-24 02:48:35 +08:00
4f194aa101 升级js-cookie到最新版本3.0.1 2021-11-22 18:07:33 +08:00
ef4bfde4a8 优化提示信息 2021-11-22 18:06:44 +08:00
421593c0ba 添加新群号:101539465 2021-11-20 12:09:53 +08:00
91ad85aec1 添加新群号:264312783 2021-11-19 15:20:54 +08:00
d1eacc1d1c 新增tab对象简化页签操作 2021-11-19 14:53:40 +08:00
e41dd8a0f1 !370 fix 修复关闭 xss 功能导致可重复读 RepeatableFilter 失效
Merge pull request !370 from 疯狂的狮子Li/master
2021-11-19 06:53:16 +00:00
9a7bb81cd0 fix 修复关闭 xss 功能导致可重复读 RepeatableFilter 失效 2021-11-19 13:01:30 +08:00
fcf606acde 升级jsencrypt到最新版本3.2.1 2021-11-18 17:50:49 +08:00
084907eeca !369 代码生成模板缺少事务
Merge pull request !369 from lihy2021/N/A
2021-11-18 09:47:35 +00:00
8de93d35ed 代码生成模板缺少事务 2021-11-17 07:56:24 +00:00
cedd2d1daf 优化导出数据操作 2021-11-17 11:57:17 +08:00
2ab96587ef 任务参数忽略双引号中的逗号 2021-11-16 16:05:15 +08:00
cb9c0e79eb 升级core-js到最新版本3.19.1 2021-11-16 14:15:17 +08:00
96d2b2d6b8 !368 【轻量级 PR】: 统一全局配置文件
Merge pull request !368 from XTvLi/master
2021-11-16 05:43:07 +00:00
b00171366f 统一全局配置内容, 删除临时调用配置文件 2021-11-10 18:17:43 +08:00
4e817a1109 升级axios到最新版本0.24.0 2021-11-10 11:14:50 +08:00
d185d4e4cc 增加sendGet无参请求方法 2021-11-10 11:13:27 +08:00
bbbe83b737 添加新群号:101539465 2021-11-02 14:40:21 +08:00
cc4c52c998 任务屏蔽违规字符 2021-11-01 15:03:06 +08:00
bd09e5b11c 修复字符串无法被反转义问题 2021-11-01 15:02:47 +08:00
181f62c15e 回显数据字典键值修正 2021-11-01 14:40:00 +08:00
3ae5ec92a5 登录/验证码请求headers不设置token 2021-11-01 13:29:27 +08:00
2fe919b6ce !361 优化一些布尔判断语法
Merge pull request !361 from 清溪先生/master
2021-11-01 05:28:59 +00:00
13c770b6be 优化一些布尔判断语法 2021-10-27 19:03:29 +08:00
2eb55528ec 升级spring-boot到最新版本2.5.6 2021-10-27 16:23:35 +08:00
839f631d6b 添加Jaxb依赖,防止jdk8以上出现的兼容错误 2021-10-27 16:22:57 +08:00
8faae71157 !359 update ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java.
Merge pull request !359 from Remenber_Ray/N/A
2021-10-27 07:37:19 +00:00
b87e0fa124 !358 update ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java.
Merge pull request !358 from 雪丛/N/A
2021-10-27 07:34:47 +00:00
b6596d021b 替换自定义验证注解 2021-10-26 17:22:20 +08:00
0628dc9b2f update ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java. 2021-10-26 08:02:48 +00:00
790aa0d24b update ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java.
增加删除Hash中的数据
2021-10-26 01:42:12 +00:00
8a7dcf8a80 修正错别字 2021-10-25 10:26:00 +08:00
0c30ffa11f !354 update ruoyi-common/src/main/java/com/ruoyi/common/utils/Threads.java.
Merge pull request !354 from Remenber_Ray/N/A
2021-10-25 01:55:51 +00:00
0904bf6446 !355 fix 跨域访问之后 下载无法获取 download-filename
Merge pull request !355 from 疯狂的狮子Li/master
2021-10-25 01:55:23 +00:00
4583787759 fix 跨域访问之后 下载无法获取 download-filename 2021-10-24 17:13:04 +08:00
17550a5f4b update ruoyi-common/src/main/java/com/ruoyi/common/utils/Threads.java.
修复描述错误
2021-10-24 02:34:25 +00:00
a4558c32b2 解析blob响应是否登录失效 2021-10-23 10:23:32 +08:00
ef4fef3d56 update ry.sh. 2021-10-23 10:21:02 +08:00
3dbbc6a223 AjaxResult重写put方法,以方便链式调用 2021-10-22 16:23:08 +08:00
d3696f5223 !347 update ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java.
Merge pull request !347 from abbfun/N/A
2021-10-22 08:19:00 +00:00
2d7d137abd update ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java.
AjaxResult链式调用
2021-10-22 03:09:54 +00:00
c2a179e9dd 新增认证对象简化权限验证 2021-10-20 11:21:11 +08:00
519ea854d5 生产环境使用路由懒加载提升页面响应速度 2021-10-15 17:57:46 +08:00
e66d0e4f74 角色列表返回类型保持一致 2021-10-15 17:56:57 +08:00
e7afea4cb7 升级oshi到最新版本v5.8.2 2021-10-14 16:20:18 +08:00
6d6271d6c9 修复五级以上菜单404问题 2021-10-14 16:19:46 +08:00
eb4376b649 Excel导入支持@Excels注解 2021-10-10 14:30:08 +08:00
b1e5ebab8f 升级spring-boot-mybatis到最新版2.2.0 2021-10-10 11:26:50 +08:00
8bd6296721 升级pagehelper到最新版1.4.0 2021-10-10 11:25:37 +08:00
ae5c68368b 升级SpringBoot到最新版本2.5.5 2021-10-10 11:24:16 +08:00
4fdb0f48ec 同步element2.15.6表格样式 2021-10-10 11:23:04 +08:00
c4207f640b 使用JSONField忽略字段 2021-10-10 11:21:46 +08:00
f6e477b4f5 升级druid到最新版1.2.8 2021-10-10 09:44:14 +08:00
7ae47b50b8 导入模板添加默认参数 2021-10-09 12:22:55 +08:00
0b14155a75 增加 sendGet 无参判断 2021-10-09 12:22:54 +08:00
f1fed76273 升级element-ui到最新版本2.15.6 2021-10-09 12:22:48 +08:00
48813161f6 设置mybatis默认的执行器 2021-10-04 10:27:38 +08:00
a006904724 fix 2021-09-30 03:18:41 +00:00
5477ce3c39 修正swagger没有指定dataTypeClass导致启动出现warn日志 2021-09-29 19:51:48 +08:00
25f50d74c5 升级sass-loader到最新版本10.1.1 2021-09-27 18:54:43 +08:00
266f4d6806 升级dart-sass到版本1.32.13 2021-09-27 18:54:10 +08:00
ded99502ae 新增通用方法简化下载使用 2021-09-27 10:38:29 +08:00
02b95f95a8 升级file-saver到最新版本2.0.5 2021-09-27 10:36:43 +08:00
2a6d2d733e 升级dart-sass到最新版本1.42.1 2021-09-27 10:32:03 +08:00
30c89b33fe Excel注解支持导入导出标题信息 2021-09-26 09:03:01 +08:00
7479ff4b06 修复xss过滤后格式出现的异常 2021-09-25 17:12:37 +08:00
821f40882f !332 fix 自动生成代码漏掉 this.#[[$modal]]#.msgError
Merge pull request !332 from 疯狂的狮子Li/N/A
2021-09-24 06:50:50 +00:00
02ce9868a7 fix 自动生成代码漏掉 this.#[[$modal]]#.msgError 2021-09-24 05:41:55 +00:00
a8f2ff4531 !331 update 代码生成编辑页面 拼写错误修正
Merge pull request !331 from 疯狂的狮子Li/master
2021-09-24 02:07:44 +00:00
eaa3baab3c update 代码生成编辑页面 拼写错误修正 2021-09-24 10:06:23 +08:00
6480282826 升级fastjson到最新版1.2.78 2021-09-24 09:28:46 +08:00
6197ad5090 !330 优化 记录登录信息,移除不必要的修改
Merge pull request !330 from lihy2021/N/A
2021-09-24 01:27:57 +00:00
b477e40d3c 优化 记录登录信息,移除不必要的修改 2021-09-24 00:41:43 +00:00
f8cc7ce328 限流返回类型转换数值型的格式 2021-09-23 19:15:33 +08:00
1a5881b1d0 修正服务监控磁盘变量 2021-09-23 19:09:22 +08:00
fa124aeb8b 新增通用方法简化模态/缓存使用 2021-09-23 09:57:29 +08:00
258335cc65 新增通用方法简化模态/缓存使用 2021-09-23 09:38:16 +08:00
3b42abef44 Excel注解支持自定义数据处理器 2021-09-22 09:03:01 +08:00
26f0737c60 防重提交注解支持配置间隔时间/提示消息 2021-09-20 19:09:25 +08:00
ac94242875 reset dataSourceAspect 2021-09-20 19:08:50 +08:00
54bfa627f0 防止Excel导入图片可能出现的异常 2021-09-20 19:04:57 +08:00
36c058188a 防止记录日志转换出现的异常 2021-09-20 19:04:40 +08:00
a292cccb63 代码生成点击预览重置激活tab 2021-09-18 18:58:03 +08:00
5ccd9877b4 !325 update 优化aop语法 使用spring自动注入注解 基于注解拦截的aop注解不可能为空
Merge pull request !325 from 疯狂的狮子Li/master
2021-09-18 10:47:06 +00:00
7108ec41b5 !322 Cron表达式生成器关闭时销毁,避免再次打开时存在上一次修改的数据
Merge pull request !322 from muyi/master
2021-09-18 10:43:59 +00:00
5188d56b4a !321 修复 全局限流key会多出一个"-" 将其移动到IP后面 去除多余的空格
Merge pull request !321 from 疯狂的狮子Li/N/A
2021-09-18 10:41:03 +00:00
8f7ed66544 update 优化aop语法 使用spring自动注入注解 基于注解拦截的aop注解不可能为空 2021-09-18 18:20:21 +08:00
yjb
aaae404b2a Cron表达式生成器关闭时销毁,避免再次打开时存在上一次修改的数据 2021-09-17 19:14:41 +08:00
f3a8b4625f 修复 全局限流key会多出一个"-" 将其移动到IP后面 去除多余的空格 2021-09-17 09:32:43 +00:00
12ab8b03d9 使用vue-data-dict,简化数据字典使用 2021-09-17 15:36:54 +08:00
23270c60bc 日志注解新增是否保存响应参数 2021-09-16 16:03:49 +08:00
2cb6709323 !318 修复后端主子表代码模板方法名生成错误问题
Merge pull request !318 from 稚屿/N/A
2021-09-16 07:48:08 +00:00
917bc03a43 !316 禁用DictTag中el-tag渐变动画
Merge pull request !316 from 马小法/master
2021-09-16 07:34:34 +00:00
dbe3446b63 修复后端主子表代码模板方法名生成错误问题 2021-09-14 13:53:32 +00:00
b84e7013d2 禁用el-tag组件的渐变动画 2021-09-14 15:15:22 +08:00
db193a46e8 若依 3.7.0 2021-09-13 09:36:38 +08:00
04c340627d 修复多图组件验证失败被删除问题 2021-09-10 11:06:25 +08:00
15abd4d053 优化提示 2021-09-08 11:26:08 +08:00
a7376b36f8 !312 修复代码生成页面数据编辑保存之后总是跳转第一页的问题
Merge pull request !312 from 稚屿/master
2021-09-08 03:19:59 +00:00
d2b61762b7 修复代码生成页面数据编辑保存之后总是跳转第一页的问题 2021-09-08 11:18:35 +08:00
a5e38f6f99 菜单管理支持配置路由参数 2021-09-08 09:28:23 +08:00
4988b585f8 !309 修正单词拼写错误
Merge pull request !309 from 稚屿/master
2021-09-07 08:16:58 +00:00
b35f708c07 修正单词拼写错误 2021-09-05 21:36:33 +08:00
0e6150720c 页签新增关闭左侧 2021-09-05 13:27:58 +08:00
44adf03d2c 页签右键按钮添加图标 2021-09-05 13:26:45 +08:00
9ae5edaa74 菜单&部门新增展开/折叠功能 2021-09-04 12:10:33 +08:00
14c6c796e8 新增暗色菜单风格主题 2021-09-04 12:09:55 +08:00
5d72f9d224 修复保存配置主题颜色失效问题 2021-09-03 16:50:48 +08:00
e49f0cebf1 自定义弹层溢出滚动样式 2021-09-03 13:27:03 +08:00
6361e4efdc 定时任务支持在线生成cron表达式 2021-09-03 09:54:07 +08:00
cfa86bd4fe !308 代码生成: 导入表时查询 新创建表的优先排序在前面
Merge pull request !308 from xiaoshitou/N/A
2021-09-03 01:39:40 +00:00
a56bc47a81 代码生成: 导入表时查询 新创建表的优先排序在前面 2021-09-02 20:01:25 +00:00
a15bfdfb46 防止表格最后页最后项删除变成暂无数据 2021-09-02 10:55:10 +08:00
ee823b8326 防止表格最后页最后项删除变成暂无数据 2021-09-02 10:19:04 +08:00
57178e72a4 !304 修改数据字典样式回显
Merge pull request !304 from 马小法/master
2021-09-01 01:20:59 +00:00
b8317a562c !303 修改非管理员登录时,获取菜单报错sql
Merge pull request !303 from Gold_Fish/master
2021-08-30 08:59:55 +00:00
8040ad8c03 修改数据字典回显 2021-08-30 16:53:16 +08:00
c628aa5be8 修改代码生成字典回显样式 2021-08-30 16:49:30 +08:00
b036e78d85 修改根据userId获取菜单sql 2021-08-30 02:42:49 +00:00
4e8c6fb7c0 修复字典组件值为整形不显示问题 2021-08-29 15:57:01 +08:00
134835c870 验证码默认20s超时 2021-08-29 15:56:46 +08:00
5ade90debf !299 XssHttpServletRequestWrapper中增加available方法
Merge pull request !299 from Ming/master
2021-08-29 07:36:57 +00:00
bb0aeb39e3 !298 修复带utc日期格式 yyyy-MM-dd'T'HH:mm:ss.SSS 在safari浏览器中无法正确格式化的问题
Merge pull request !298 from wjtc8/N/A
2021-08-29 07:35:06 +00:00
098c650655 update ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java.
增加available方法于XssHttpServletRequestWrapper
2021-08-24 08:42:56 +00:00
e52092c6d4 修改时检查用户数据权限范围 2021-08-24 16:00:39 +08:00
89911e7caf 修复带utc日期格式 yyyy-MM-dd'T'HH:mm:ss.SSS 在safari浏览器中无法正确格式化的问题 2021-08-24 05:51:00 +00:00
0fc266fe80 定时任务对检查异常进行事务回滚 2021-08-24 11:12:11 +08:00
d1ef19f08a 自定义可拖动弹窗高度指令 2021-08-20 17:57:44 +08:00
e6e10308ff 自定义可拖动弹窗宽度指令 2021-08-20 17:45:25 +08:00
cb5ee9c8a1 补充定时任务表字段注释 2021-08-20 11:04:15 +08:00
1e37f0430b 定时任务屏蔽ldap远程调用 2021-08-19 15:26:22 +08:00
295173258c !295 update 优化 使用权限工具 获取用户信息
Merge pull request !295 from 疯狂的狮子Li/update
2021-08-19 06:55:13 +00:00
fec90d0487 !294 update ruoyi-ui/src/layout/index.vue.
Merge pull request !294 from aasdd/N/A
2021-08-19 06:49:06 +00:00
aead560227 update 优化 使用权限工具 获取用户信息 2021-08-19 11:13:59 +08:00
8133c60ab3 update ruoyi-ui/src/layout/index.vue.
删掉此处代码,使右边栏动画生效。现在是没有动画的
2021-08-18 09:29:22 +00:00
5c155f5f11 支持自定义注解实现接口限流 2021-08-17 14:08:18 +08:00
03cf98d3c9 优化异常信息 2021-08-16 16:25:25 +08:00
6f51f729ba !289 添加日期范围支持重复添加多组日期范围,请求参数中对象的属性为null、undefined不进行拼接
Merge pull request !289 from wangzhaoqiang/master
2021-08-16 08:23:27 +00:00
57b159eb98 添加日期范围支持重复添加多组日期范围,请求参数中对象的属性为null、undefined不进行拼接 2021-08-16 14:48:34 +08:00
08da6834a5 !288 修正方法名单词拼写错误
Merge pull request !288 from 稚屿/N/A
2021-08-16 02:36:36 +00:00
268468fb47 !287 更新到【默认首页使用keep-alive缓存】后报错
Merge pull request !287 from wangzhaoqiang/master
2021-08-16 02:36:29 +00:00
333e19339c 修正方法名单词拼写错误 2021-08-15 10:26:05 +00:00
7b6ccd9b22 解决登录后浏览器后台Breadcrumb组件报错 2021-08-14 20:16:48 +08:00
5d6f134609 多图上传组件移除多余的api地址 2021-08-13 15:15:35 +08:00
f02743bde5 代码生成主子表多选行数据 2021-08-13 14:50:35 +08:00
3003bb0f50 Excel注解图片导入兼容xls 2021-08-13 10:56:35 +08:00
5139265d32 默认首页使用keep-alive缓存 2021-08-13 10:10:29 +08:00
8a67af6c26 !285 修复角色分配用户页面接收参数与传递参数类型不一致导致的错误
Merge pull request !285 from 稚屿/N/A
2021-08-13 01:55:58 +00:00
8e4802505e !284 添加SysConfigservice,SysDictTypeService的实现方法遗漏的@Override注解
Merge pull request !284 from Old丶x/master
2021-08-13 01:55:52 +00:00
8ee641c1bc 修复角色分配用户页面接收参数与传递参数类型不一致导致的错误 2021-08-13 01:08:00 +00:00
779508989f 添加加载字典数据,清空字典数据,重置字典数据方法上遗漏的@Override注解 2021-08-12 17:30:31 +08:00
d9e805a6a5 添加获取验证码方法上遗漏的@Override注解 2021-08-12 17:19:56 +08:00
7be17ea89a Excel注解支持Image图片导入 2021-08-11 10:13:34 +08:00
1f07641d9b update bin 2021-08-11 10:11:13 +08:00
c0f4f805d0 !281 补全注册用户方法上遗漏的@Override注解
Merge pull request !281 from 稚屿/N/A
2021-08-11 02:08:58 +00:00
b84224d7ba 补全注册用户方法上遗漏的@Override注解 2021-08-08 14:08:52 +00:00
98a143f1fe 添加新群号:101456076 2021-08-08 19:50:50 +08:00
3243428009 优化用户不能删除自己 2021-08-08 19:12:52 +08:00
7736097f6b 提取通用方法到基类控制器 2021-08-08 19:12:12 +08:00
fc60c003c3 升级element-ui到最新版本2.15.5 2021-08-06 14:31:39 +08:00
68ae4df2dc 升级commons.io到最新版本v2.11.0 2021-07-31 17:52:06 +08:00
de33e6ecc8 优化代码生成模板 2021-07-30 22:18:20 +08:00
a1cc346aca 优化代码生成模板 2021-07-30 21:50:47 +08:00
5397e345ca 新增是否开启用户注册功能 2021-07-30 21:23:35 +08:00
8ed7916b61 定时任务屏蔽http(s)远程调用 2021-07-30 11:28:46 +08:00
2de5cc52d1 启用父部门状态排除顶级节点 2021-07-30 11:28:04 +08:00
f6bc28000e 防止错误token导致的解析异常 2021-07-29 17:32:55 +08:00
6b5dd4d2be 优化XSS跨站脚本过滤 2021-07-28 16:04:59 +08:00
e6becb9337 BLOB下载时清除URL对象引用 2021-07-28 13:13:28 +08:00
8da55fb72a 添加新群号:101456076 2021-07-28 09:51:19 +08:00
6a5c86541a 跳转路由高亮相对应的菜单栏 2021-07-27 11:54:20 +08:00
3803ac78e2 升级oshi到最新版本v5.8.0 2021-07-27 11:53:59 +08:00
4095a1b6ee !275 fix Issue #I42GRW 任意账户越权漏洞
Merge pull request !275 from lagXkjy/master
2021-07-27 02:08:04 +00:00
3347ca4d74 fix:Issue #I42GRW 修复任意账户越权漏洞 2021-07-27 09:33:12 +08:00
9b1883988b 升级element-ui到最新版本2.15.3 2021-07-26 09:50:58 +08:00
49c8a007cc 修复定时任务日志执行状态显示 2021-07-26 09:50:33 +08:00
64f6d28441 角色&菜单新增字段属性提示信息 2021-07-25 20:08:55 +08:00
c26d87c677 内链设置meta信息 2021-07-25 20:05:18 +08:00
97ae0eb7c7 密码框新增显示切换密码图标 2021-07-25 19:13:56 +08:00
6c1cccd031 导入用户样式调整 2021-07-25 19:08:00 +08:00
856d1ceba8 顶部菜单样式调整 2021-07-25 19:06:57 +08:00
60673b3b64 去除默认分页合理化参数 2021-07-25 10:35:37 +08:00
0a516e3001 更多操作按钮添加权限控制 2021-07-25 10:20:52 +08:00
bb87f35797 富文本新增上传文件大小限制 2021-07-25 08:57:01 +08:00
c43f9bc3c2 顶部菜单排除隐藏的默认路由 2021-07-24 18:20:55 +08:00
46b43b1bd9 !269 code=401时request方法没有返回Promise.reject 修复
Merge pull request !269 from 严俊东/N/A
2021-07-24 02:48:01 +00:00
8dbda47174 !268 修正方法名单词拼写错误
Merge pull request !268 from 稚屿/N/A
2021-07-23 11:34:30 +00:00
cdace51197 code=401时request方法没有返回Promise.reject 修复 2021-07-20 04:49:22 +00:00
c24fc4282c 修正方法名单词拼写错误 2021-07-20 00:54:50 +00:00
b616a2f2e7 定时任务新增更多操作 2021-07-15 17:35:33 +08:00
60abdf1dbc 升级oshi到最新版本v5.7.5 2021-07-14 09:53:26 +08:00
7b894da43c 参数管理支持配置验证码开关 2021-07-13 10:30:40 +08:00
c8b66f9b04 删除富文本video事件 2021-07-13 10:28:55 +08:00
25d9edd5c9 !259 图片上传 - 多图时无法删除相应图片修复
Merge pull request !259 from 严俊东/N/A
2021-07-13 02:26:10 +00:00
77a21d098f 图片上传 - 多图时无法删除相应图片修复 2021-07-12 03:01:50 +00:00
170cfb356c 若依 3.6.0 2021-07-12 08:42:11 +08:00
5879c2484a 菜单路由配置支持内链访问 2021-07-11 16:31:10 +08:00
c02dad2ca3 默认访问首页新增提示语 2021-07-11 15:28:11 +08:00
1bfa14e3c6 富文本默认上传返回url类型 2021-07-10 12:17:32 +08:00
5dec58e7f5 自定义弹窗拖拽指令 2021-07-09 17:12:29 +08:00
8321f92d2c 全局注册通用组件 2021-07-09 17:09:57 +08:00
da1095e298 授权用户添加访问权限 2021-07-09 17:08:30 +08:00
f56da498ab ImageUpload组件支持多图片上传 2021-07-08 19:17:09 +08:00
e259093e01 文件上传组件添加数量限制属性 2021-07-08 15:49:04 +08:00
e963a86b15 富文本编辑组件添加类型属性 2021-07-08 15:48:11 +08:00
e447fb806b FileUpload组件支持多文件上传 2021-07-08 12:36:02 +08:00
90c41d498c 角色管理新增分配用户功能 2021-07-05 14:54:09 +08:00
ce6bea4ba0 限制超级管理员不允许操作 2021-07-05 09:57:15 +08:00
9c7901f526 用户管理新增分配角色功能 2021-07-01 18:01:36 +08:00
04f5a93aa8 升级pagehelper到最新版1.3.1 2021-06-25 17:25:49 +08:00
751ca90690 !251 修复日志列表取消字段排序时的报错问题
Merge pull request !251 from 稚屿/N/A
2021-06-25 09:23:45 +00:00
1dfeae6a03 修复日志列表取消字段排序时的报错问题 2021-06-24 00:27:37 +00:00
1ed60c79c0 用户信息长度校验限制 2021-06-22 20:45:19 +08:00
aee1e53140 全局挂载字典标签组件 2021-06-22 20:44:40 +08:00
253e2b2de1 增加字典标签样式回显 2021-06-22 14:24:26 +08:00
b1413f021e 增加字典标签样式回显 2021-06-22 14:04:14 +08:00
60c22b6a43 update ry.sh. 2021-06-17 21:29:00 +08:00
3f05ed6ffa 封装iframe组件 2021-06-17 20:17:42 +08:00
090ad5323a 日志列表支持排序操作 2021-06-17 12:30:43 +08:00
3e90fd010d 升级commons.fileupload到最新版本v1.4 2021-06-16 09:53:00 +08:00
462862ba65 升级commons.io到最新版本v2.10.0 2021-06-16 09:52:38 +08:00
7601a72faf 升级element-ui到最新版本2.15.2 2021-06-15 10:26:19 +08:00
7ab14ff293 定时任务屏蔽rmi远程调用 2021-06-15 10:26:02 +08:00
200106df39 升级oshi到最新版本v5.7.4 2021-06-11 10:29:14 +08:00
ea66e20282 修复用户搜索分页变量错误 2021-06-10 22:36:22 +08:00
a209b39552 分页组件新增pagerCount属性 2021-06-10 22:29:13 +08:00
557672ba9f 系统布局配置支持动态标题开关 2021-06-10 18:05:27 +08:00
a3116cd27d 优化部门父级启用状态 2021-06-10 15:34:38 +08:00
2ace3257f9 升级swagger到最新版本v3.0.0 2021-06-09 20:07:36 +08:00
c16ee7fc2c 升级swagger到最新版本v3.0.0 2021-06-08 16:34:36 +08:00
fd33fe869d 修复导出角色数据范围翻译缺少仅本人 2021-06-08 16:27:24 +08:00
b7446f8d0f 富文本工具栏配置视频 2021-06-03 13:26:09 +08:00
19924cd184 修复关闭confirm提示框控制台报错问题 2021-06-03 13:24:29 +08:00
85470a1549 修复表单构建选择下拉选择控制台报错问题 2021-06-02 20:43:34 +08:00
2a604c0548 !237 同步菜单新增、修改界面“功能权限”maxlength为100(保持与数据库字段长度一致),避免因超过50后不能录入问题
Merge pull request !237 from 老李/origin
2021-06-02 20:40:09 +08:00
b7f3c68eca 优化图片工具类读取文件 2021-06-02 11:45:40 +08:00
edd2981076 调整用户测试接口swagger注解 2021-06-02 11:45:30 +08:00
c105a63c8b 添加bat脚本执行应用 2021-05-31 12:16:27 +08:00
01fef0b9e1 同步菜单新增、修改界面“功能权限”maxlength为100(保持与数据库字段长度一致),避免因超过50后不能录入问题 2021-05-31 10:31:50 +08:00
af9cfb40a4 优化参数&字典缓存操作 2021-05-27 17:38:44 +08:00
6fa3bfe051 修复两处存在SQL注入漏洞问题 2021-05-27 17:38:27 +08:00
5e64a93d11 若依 3.5.0 2021-05-25 09:37:55 +08:00
4aabf5d8be Redis设置HashKey序列化 2021-05-24 15:10:55 +08:00
cf6254a8d5 用户登录后记录最后登录IP&时间 2021-05-24 14:21:29 +08:00
883cff5de9 新增IE浏览器版本过低提示页面 2021-05-24 14:15:41 +08:00
7e79c4f249 生成vue模板导出按钮点击后添加遮罩 2021-05-24 11:34:03 +08:00
504638eb41 !234 【轻量级 PR】:删去两处冗余代码
Merge pull request !234 from xivLi/master
2021-05-24 11:30:21 +08:00
2adac4a899 升级fastjson到最新版1.2.76 2021-05-24 11:25:17 +08:00
56a943bf48 升级druid到最新版本v1.2.6 2021-05-24 11:24:54 +08:00
77ebca264a 修复请求形参未传值记录日志异常问题 2021-05-23 19:22:30 +08:00
7b94ae3a9a xss校验json条件优化 2021-05-23 19:20:36 +08:00
bd1edc6dcc !233 修正方法名单词拼写错误
Merge pull request !233 from lyqwer/N/A
2021-05-23 17:15:18 +08:00
09d166e97d !231 修正注释
Merge pull request !231 from 刘立伟/N/A
2021-05-23 17:14:52 +08:00
f3e5d908d6 quartz模块下 domain包中的 SysJob类不需要实现Serializable接口 2021-05-22 16:05:12 +08:00
9651a7d7fc 删去utils.uuid下 IdUtils类中 多余的import(同包下的UUID类) 2021-05-22 15:52:19 +08:00
b2914cbcb1 修正方法名单词拼写错误 2021-05-21 17:24:48 +08:00
d0a4d6b111 修正注释 2021-05-18 10:21:48 +08:00
b431703262 导出按钮点击之后添加遮罩 2021-05-17 15:37:58 +08:00
99726be9ac 修正导入表权限标识 2021-05-11 14:26:20 +08:00
32f333a00e 删除操作日志记录日志 2021-05-11 14:25:39 +08:00
be5c19b764 树级结构更新子节点使用replaceFirst 2021-05-11 14:25:25 +08:00
dd384e4a31 上传媒体类型添加视频格式 2021-05-11 14:25:08 +08:00
bdde195e2b !225 【bug修复】文件上传时出现java.nio.file.FileAlreadyExistsException
Merge pull request !225 from CANYON/master
2021-05-11 14:19:53 +08:00
14ea071306 修复文件上传时java.nio.file.FileAlreadyExistsException 2021-05-08 15:31:16 +08:00
50034301ac 添加新群号:201396349 2021-05-06 20:40:25 +08:00
85ed712c50 !222 update ruoyi-ui/src/assets/styles/element-ui.scss.
Merge pull request !222 from leizhuogogo/N/A
2021-05-06 20:39:36 +08:00
f67d682345 !221 update ruoyi-common/src/main/java/com/ruoyi/common/utils/Arith.java.
Merge pull request !221 from phper08/N/A
2021-05-06 20:39:26 +08:00
3f1427eef9 update ruoyi-ui/src/assets/styles/element-ui.scss. 2021-05-06 17:50:28 +08:00
7d0f5e94ef update ruoyi-common/src/main/java/com/ruoyi/common/utils/Arith.java. 2021-05-03 13:18:33 +08:00
62081aebb9 修复开启TopNav后,左侧打开外链问题 2021-04-21 16:34:44 +08:00
3f07632cd4 修复一级菜单包屑显示重复问题 2021-04-21 15:14:36 +08:00
2c94587263 优化ExcelUtil空值处理 2021-04-21 09:53:14 +08:00
2575c17f47 主题颜色保存配置 2021-04-19 16:59:56 +08:00
b6f13c546b 过滤BindingResult对象,防止异常 2021-04-18 21:54:53 +08:00
e60a69b670 兼容顶部栏一级菜单内部跳转 2021-04-18 18:33:13 +08:00
cb18eec802 修正模板字符编码 2021-04-18 15:45:49 +08:00
bef080c60a 升级mybatis到最新版3.5.6 阻止远程代码执行漏洞 2021-04-18 15:45:37 +08:00
de73cf300b 优化树表代码生成模板 2021-04-15 10:39:09 +08:00
cbcee86d2c 优化树表代码生成模板 2021-04-15 10:37:22 +08:00
cc50224d90 固定顶部导航栏&窗口大小改变实时更新栏数 2021-04-14 11:01:16 +08:00
ff09e1cf55 数据监控默认地址修改 2021-04-13 18:15:11 +08:00
fe2ccbdc1b 优化代码生成导出模板名称 2021-04-13 14:49:42 +08:00
c8df1f5e1f 布局设置支持保存&重置配置 2021-04-13 09:47:28 +08:00
e71c00e6fa 富文本编辑器支持自定义上传地址 2021-04-13 09:38:32 +08:00
dcb9839596 !209 导出 Excel 工作表的名称 由 ${businessName} 更改为 ${functionName}
Merge pull request !209 from lihy2021/N/A
2021-04-13 09:36:49 +08:00
f13b6d92d2 !205 富文本编辑器自定义上传地址
Merge pull request !205 from hechieh/N/A
2021-04-13 09:36:42 +08:00
6595c68df1 导出 Excel 工作表的名称 由 ${businessName} 更改为 ${functionName} 2021-04-12 14:52:14 +08:00
5a2a0c09b6 优化主子表代码生成 2021-04-12 13:26:54 +08:00
9aac65ff32 新增菜单导航显示风格TopNav(false为左侧导航菜单,true为顶部导航菜单) 2021-04-12 09:54:08 +08:00
5f2350569a 页签新增关闭右侧 2021-04-10 21:15:45 +08:00
ccf05b697d 富文本编辑器自定义上传地址 2021-04-10 17:08:49 +08:00
6810243ab7 修复树表数据显示不全&加载慢问题 2021-04-09 08:31:13 +08:00
b56b8846d9 修改主题后mini类型按钮无效问题 2021-04-08 13:54:48 +08:00
8e1e4cd8fe 通用下载完成后删除节点 2021-04-08 13:46:22 +08:00
9fa5c79713 !200 update ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java.
Merge pull request !200 from yvan7123/N/A
2021-04-08 13:42:30 +08:00
40a72c2b7e !199 规范命名、用户角色单个逻辑删除、去除多余代码
Merge pull request !199 from fuzui/some_problems
2021-04-08 13:40:28 +08:00
6fe9a358b7 update ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java. 2021-04-06 11:47:27 +08:00
9f6bc13e64 🔥 去除多余代码 2021-04-02 23:06:48 +08:00
ba5ab4b091 用户、角色单条删除时,使其逻辑删除 2021-04-02 22:49:19 +08:00
17407d0127 调整cache_repeat_key为驼峰格式 2021-04-02 22:40:15 +08:00
30f330f4a0 修复firefox下表单构建拖拽会新打卡一个选项卡 2021-03-30 17:45:35 +08:00
6ca7870393 修正注释 2021-03-30 15:30:18 +08:00
2a7342ec43 !195 读取excel增加非空判断
Merge pull request !195 from 叫我宏锅锅/yuhong
2021-03-30 15:23:04 +08:00
fc57e91b80 !196 RepeatedlyRequestWrapper.ServletInputStream 实现available方法
Merge pull request !196 from wangyang/master
2021-03-30 15:17:34 +08:00
347f36ceff fix:RepeatedlyRequestWrapper.ServletInputStream 实现available方法 2021-03-29 10:17:31 +08:00
9b9c1b999f 读取excel增加
if(row == null)
{
    continue;
}
判断。防止有时候Excel表中有空数据行,导致读取时出现空指针异常。
2021-03-29 09:00:44 +08:00
ec627704b2 取消 2021-03-29 08:58:46 +08:00
9e6b2a1265 读取excel增加
if(row == null)
{
    continue;
}
判断。防止有时候Excel表中有空数据行,导致读取时出现空指针异常。
2021-03-29 08:56:51 +08:00
266a5e844f !193 修复request.getInputStream() 重复读取错误问题
Merge pull request !193 from MccRay/master
2021-03-27 13:22:01 +08:00
0822680158 update ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java.
修复 getInputStream() has already been called for this request异常问题
2021-03-25 17:39:51 +08:00
090e258bf9 显隐列初始默认隐藏列 2021-03-24 15:46:37 +08:00
505fa06dc3 !192 update ruoyi-ui/src/views/system/user/profile/userAvatar.vue.
Merge pull request !192 from 谢凯/N/A
2021-03-24 15:32:24 +08:00
6cf53bfacb !191 update ruoyi-ui/src/views/system/user/profile/userAvatar.vue.
Merge pull request !191 from allworldg/N/A
2021-03-24 15:31:51 +08:00
881dc3fcf0 update ruoyi-ui/src/views/system/user/profile/userAvatar.vue. 2021-03-22 17:52:34 +08:00
b65c8d4512 update ruoyi-ui/src/views/system/user/profile/userAvatar.vue. 2021-03-21 21:20:23 +08:00
67371a9028 个人信息添加手机&邮箱重复验证 2021-03-21 08:53:11 +08:00
01b545e4ab 通用Controller添加响应返回消息 2021-03-16 14:43:55 +08:00
c2e9200626 数据监控默认账户密码防止越权访问 2021-03-14 16:37:34 +08:00
9502203bbe !187 【漏洞修复】升级commons-collections版本,解决3.2.1版本的反序列化漏洞问题
Merge pull request !187 from Delusive/master
2021-03-14 16:32:07 +08:00
c0f1569ad9 修复commons-collections引起的反序列化漏洞 2021-03-12 16:59:06 +08:00
61432480c8 删除多余的代码 2021-03-07 11:06:47 +08:00
78deee063d !180 富文本编辑组件支持只读
Merge pull request !180 from JOSWAY/master
2021-03-07 10:44:04 +08:00
4ad003649e !182 解决 Byte[] 类型 to string 死循环的问题
Merge pull request !182 from sproutcat/master
2021-03-07 10:39:41 +08:00
616f5a6aca !185 update ruoyi-ui/src/views/monitor/logininfor/index.vue.
Merge pull request !185 from asher/N/A
2021-03-07 10:39:30 +08:00
fea3ff7b2a !184 update ruoyi-ui/src/views/monitor/operlog/index.vue.
Merge pull request !184 from asher/N/A
2021-03-07 10:39:22 +08:00
f938a24df0 update ruoyi-ui/src/views/monitor/logininfor/index.vue. 2021-03-04 17:00:07 +08:00
45fa686a64 update ruoyi-ui/src/views/monitor/operlog/index.vue. 2021-03-04 16:58:18 +08:00
0d8c3b4940 升级oshi到最新版本v5.6.0 2021-03-03 13:53:03 +08:00
64e807f27b 添加新群号:186866453 2021-02-24 13:45:24 +08:00
tzg
9a384a2fc2 解决 Byte[] 类型 to string 死循环的问题 2021-02-23 16:30:14 +08:00
339b932a3d 富文本编辑组件支持只读 2021-02-22 17:49:17 +08:00
0b5c7f4c96 若依 3.4.0 2021-02-22 09:40:28 +08:00
265e3010aa 升级SpringBoot到最新版本2.2.13 2021-02-21 11:01:56 +08:00
b7a36bfe8a 修改ip字段长度防止ipv6地址长度不够 2021-02-10 12:48:52 +08:00
3a51c53823 角色非自定义权限范围清空选择值 2021-02-06 10:34:12 +08:00
df504c5c14 修复四级菜单无法显示问题 2021-02-06 09:29:50 +08:00
baeed2e8d3 修复角色管理-编辑角色-功能权限显示异常 2021-02-02 16:25:37 +08:00
2903de1561 升级element-ui到最新版本2.15.0 2021-01-24 12:06:19 +08:00
cca2f5c62d update README.md 2021-01-14 13:20:08 +08:00
ce54416e4f 升级fastjson到最新版1.2.75 2021-01-13 16:20:39 +08:00
bd19892aff 修复生成树表代码异常 2021-01-13 16:19:23 +08:00
14a859899c 代码生成模板支持主子表 2021-01-08 10:47:36 +08:00
f3cb18c836 !161 修复导入数据为负浮点数时,导入结果会丢失精度问题
Merge pull request !161 from 嘿白熊/master
2021-01-08 10:46:36 +08:00
7d0eb3b8c7 用户显隐列添加不同key防止被复用 2021-01-07 13:28:16 +08:00
654aa6b30c 表格右侧工具栏组件支持显隐列 2021-01-06 17:30:39 +08:00
b7cdd10f9f 修复导入数据为负浮点数时丢失精度问题 2021-01-06 11:11:11 +08:00
9bd35cb7be 升级druid到最新版本v1.2.4 2021-01-06 11:00:20 +08:00
7a86c714fc 代码生成支持文件上传组件 2021-01-06 11:00:09 +08:00
edd090a098 代码生成支持文件上传组件 2021-01-05 20:59:14 +08:00
3cd886785b 图片组件添加预览功能 2021-01-05 20:33:41 +08:00
ae5a0f9774 新增文件上传组件 2021-01-05 20:11:09 +08:00
074b3c735d 设置单图上传控件 2021-01-05 16:17:41 +08:00
a118738d0f 单图上传组件添加移除 2021-01-05 16:13:22 +08:00
56fa3912ae 修复IE11浏览器报错问题 2021-01-05 09:44:08 +08:00
2116ee1822 Update copyright 2021-01-04 17:49:52 +08:00
57a2eb4217 操作按钮组调整为朴素按钮样式 2021-01-04 17:48:46 +08:00
647af5b485 菜单组件修改允许空字符串 2020-12-29 17:27:48 +08:00
3f33219134 !156 修复 用户管理 -> 修改用户 手机号码 和 邮箱 不能清空
Merge pull request !156 from li_oxen/N/A
2020-12-29 17:14:31 +08:00
a04bb71777 修复 用户管理 -> 修改用户 手机号码 和 邮箱 不能清空 2020-12-29 13:51:15 +08:00
63992ac906 代码生成数据库文本类型生成表单文本域 2020-12-29 11:14:48 +08:00
0187344798 Excel注解支持Image图片导出 2020-12-27 10:04:45 +08:00
a9c6ba12e6 代码生成日期控件区分范围 2020-12-25 09:35:20 +08:00
ba068eae65 修正侧边栏静态路由丢失问题 2020-12-24 19:32:18 +08:00
1a87ee7c19 防止get请求参数值为false或0等特殊值会导致无法正确的传参
Merge pull request !146 from wugh/hotfix/gitee-issue_I2A5FU
2020-12-22 16:19:51 +08:00
3c4b01ab83 权限工具类增加admin判断 2020-12-21 19:43:57 +08:00
886ce995af [bug修复] 解决get请求,如果参数值为false或0等特殊值会导致无法正确传参 2020-12-21 11:58:15 +08:00
52264b6e2a 优化多级菜单之间切换无法缓存的问题 2020-12-21 10:50:48 +08:00
fd7e88a518 配置文件新增redis数据库索引属性 2020-12-21 10:26:54 +08:00
854a6f805f !145 redis 增加 database配置项,设置不同的库
Merge pull request !145 from li_oxen/N/A
2020-12-21 10:13:47 +08:00
1caec85f46 redis 增加 database配置项,设置不同的库 2020-12-19 10:08:09 +08:00
c86dc20743 移除path-to-regexp正则匹配插件 2020-12-17 12:05:29 +08:00
ecc7a8be46 优化多级菜单之间切换无法缓存的问题 2020-12-16 20:57:48 +08:00
e23ad20186 README 2020-12-16 10:20:02 +08:00
6cf2a8edeb 升级SpringBoot到最新版本2.2.12 提升启动速度 2020-12-16 10:05:53 +08:00
67198aede9 README 2020-12-15 10:06:12 +08:00
4f33da2a3f 登录后push添加catch防止出现检查错误 2020-12-15 10:04:09 +08:00
8988d0b4ab 若依 3.3.0 2020-12-14 09:02:10 +08:00
ceefa20aa2 调整代码生成页列宽 2020-12-13 16:05:49 +08:00
89e1f2a53f 修改Set可能导致嵌套的问题 2020-12-13 15:01:03 +08:00
6800a12014 !138 修改Set可能导致嵌套的问题
Merge pull request !138 from BecomeDream/N/A
2020-12-13 14:54:17 +08:00
e8f63b2994 修改Set可能导致嵌套的问题 2020-12-11 18:16:57 +08:00
ecfe7006e2 代码生成预览支持高亮显示 2020-12-11 17:04:54 +08:00
9e387dc447 去除用户手机邮箱部门必填验证 2020-12-11 13:26:14 +08:00
231bbf6928 !135 增加日志记录过滤对象类型(解决多文件场景报错)
Merge pull request !135 from geruishi/master
2020-12-11 13:24:03 +08:00
d6eac2dc8d 前端更新插件版本 2020-12-11 09:27:12 +08:00
b368ad764f 升级core-js到最新版本3.8.1 2020-12-10 12:08:18 +08:00
ffd5f0ce5d 升级vue-router到最新版本3.4.9 2020-12-10 11:14:44 +08:00
a50beae599 代码生成预览提供滚动机制 2020-12-10 11:13:39 +08:00
cf7f51a633 解决多文件上传Log报错 2020-12-09 16:05:09 +08:00
4d46f4c1b5 删除用户和角色解绑关联 2020-12-09 10:32:53 +08:00
a941c1b488 !134 修改 代码生成 预览无法左右滑动
Merge pull request !134 from 〝走走停停/master
2020-12-09 10:27:34 +08:00
d6b6151aea update ruoyi-ui/src/assets/styles/ruoyi.scss. 2020-12-08 17:49:51 +08:00
fbc071a573 关闭页签清理缓存数据 2020-12-08 16:43:26 +08:00
6cfff90b4a 缓存仪表图设置默认大小 2020-12-08 16:13:21 +08:00
474cca921e 回显数据字典防止空值报错 2020-12-08 16:12:00 +08:00
1657e06be6 !132 update ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java.
Merge pull request !132 from abbfun/N/A
2020-12-08 16:03:51 +08:00
c01eeb8521 update ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java. 2020-12-08 11:11:34 +08:00
f90899d72a 支持主题风格配置 2020-12-07 14:13:02 +08:00
7e78a9167f 修改用户头像预览宽高 2020-12-06 16:22:45 +08:00
563e11d9c1 get请求params添加null值判断 2020-12-06 11:05:02 +08:00
ef92ad4d8c 支持get请求映射params参数 2020-12-04 10:52:20 +08:00
d8b006c15f 升级bitwalker到最新版本1.21 2020-12-04 10:51:20 +08:00
0e2b97a886 升级poi到最新版本4.1.2 2020-12-03 13:28:04 +08:00
1c7a5faae8 Excel支持注解align对齐方式 2020-12-03 13:26:46 +08:00
23868c4fad 防止安全扫描YUI出现的风险提示 2020-12-03 10:26:22 +08:00
3b2669d148 修改缓存监控内存单位 2020-11-30 19:27:03 +08:00
1147ea5f8a 设置用户头像悬停高度 2020-11-30 11:10:27 +08:00
a1bf5aaf8e 升级element-ui版本到2.14.1 2020-11-30 10:37:48 +08:00
2797c1eb3a 修正转换字符串的目标字符集属性 2020-11-30 10:31:11 +08:00
1791d7cf40 !126 update pom.xml.
Merge pull request !126 from abbfun/N/A
2020-11-30 10:07:08 +08:00
01861f0aae update pom.xml. 2020-11-29 16:16:54 +08:00
a69cc94f35 三级菜单自动配置组件 2020-11-28 20:39:03 +08:00
c666faed66 修复三级菜单之间切换页面无法缓存的问题 2020-11-28 20:31:45 +08:00
6072239a40 修改缓存监控内存单位 2020-11-28 13:57:19 +08:00
a3b86d6f6d 代码生成删除多余的数字float类型 2020-11-28 12:09:24 +08:00
fd831d5a90 Excel支持导入Boolean型数据 2020-11-28 12:08:55 +08:00
e83412b9a5 升级oshi到最新版本v5.3.6 2020-11-24 16:17:33 +08:00
90ac416e02 新增缓存监控功能 2020-11-23 10:02:50 +08:00
5b63f0cab9 优化头像样式,鼠标移入悬停遮罩 2020-11-19 09:33:10 +08:00
8f145bba3a 若依 v3.2.1 2020-11-18 09:32:15 +08:00
6bb166b89f 阻止任意文件下载漏洞 2020-11-17 10:29:52 +08:00
823e95667e 代码生成支持上传控件 2020-11-16 16:20:17 +08:00
566053da0c 新增图片上传组件 2020-11-16 15:52:58 +08:00
0ef007240d 调整默认首页 2020-11-07 10:38:35 +08:00
0a75dcdd85 升级druid到最新版本v1.2.2 2020-11-05 13:58:36 +08:00
4c2626ffec 2020年双十一云服务器优惠,错过又要等一年 2020-11-04 16:58:28 +08:00
082b19e33a mapperLocations配置支持分隔符 2020-11-02 17:34:52 +08:00
b779cf053d !112 未选择时,点击“确认”,出现必填验证提示。使用blur的话,选择之后验证消息不会自动消失,使用change会自动消失。
Merge pull request !112 from FlyFive/N/A
2020-11-02 17:30:06 +08:00
212012dc62 未选择时,点击“确认”,出现必填验证提示。使用blur的话,选择之后验证消息不会自动消失,使用change会自动消失。 2020-11-02 11:49:25 +08:00
7de2cf77b4 !111 update ruoyi-ui/src/views/system/dept/index.vue.
Merge pull request !111 from FlyFive/N/A
2020-10-26 16:57:58 +08:00
2b9d46439f update ruoyi-ui/src/views/system/dept/index.vue.
验证的提示信息错了
2020-10-26 16:31:51 +08:00
79265d59b7 !109 误修改,回退
Merge pull request !109 from tucke/master
2020-10-26 10:00:46 +08:00
093ba5b389 误修改,回退 2020-10-26 09:53:58 +08:00
3807b11290 权限调整 2020-10-23 17:27:20 +08:00
c9f25cb34e 调整sql默认时间 2020-10-21 11:30:37 +08:00
203b54e5aa !106 update ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java.
Merge pull request !106 from abbfun/N/A
2020-10-14 17:12:57 +08:00
403f5c5dcf 解决代码生成没有bit类型的问题 2020-10-14 17:08:20 +08:00
c6d0b9a9ae update ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java.
权限字符串修正
2020-10-14 16:21:43 +08:00
08df2c93a9 删除不必要的代码 2020-10-13 14:41:26 +08:00
fbbdd94999 !105 update ruoyi-ui/src/views/system/role/index.vue.
Merge pull request !105 from FlyFive/N/A
2020-10-13 14:38:02 +08:00
0cae7d0058 update ruoyi-ui/src/views/system/role/index.vue.
getMenuAllCheckedKeys()方法中选中节点和半选节点获取的方法反了。
2020-10-12 13:50:25 +08:00
b0965653bf 删除不必要的代码 2020-10-10 17:54:30 +08:00
e472f62523 升级pagehelper到最新版1.3.0 2020-10-10 16:39:14 +08:00
429 changed files with 28305 additions and 13701 deletions

1
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1 @@
custom: http://doc.ruoyi.vip/ruoyi-vue/other/donate.html

3
.gitignore vendored
View File

@ -25,6 +25,9 @@ target/
*.iml
*.ipr
### JRebel ###
rebel.xml
### NetBeans ###
nbproject/private/
build/*

View File

@ -1,14 +1,27 @@
<p align="center">
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-d3d0a9303e11d522a06cd263f3079027715.png">
</p>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi v3.9.0</h1>
<h4 align="center">基于SpringBoot+Vue前后端分离的Java快速开发框架</h4>
<p align="center">
<a href="https://gitee.com/y_project/RuoYi-Vue/stargazers"><img src="https://gitee.com/y_project/RuoYi-Vue/badge/star.svg?theme=dark"></a>
<a href="https://gitee.com/y_project/RuoYi-Vue"><img src="https://img.shields.io/badge/RuoYi-v3.9.0-brightgreen.svg"></a>
<a href="https://gitee.com/y_project/RuoYi-Vue/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
</p>
## 平台简介
若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。
* 前端采用Vue、Element UI。
* 后端采用Spring Boot、Spring Security、Redis & Jwt。
* 权限认证使用Jwt支持多终端认证系统。
* 支持加载动态权限菜单,多方式轻松权限控制。
* 高效率开发,使用代码生成器可以一键生成前后端代码。
* 提供了一个Oracle版本[RuoYi-Vue-Oracle](https://github.com/yangzongzhuan/RuoYi-Vue-Oracle),保持同步更新。
* 提供了技术栈([Vue3](https://v3.cn.vuejs.org) [Element Plus](https://element-plus.org/zh-CN) [Vite](https://cn.vitejs.dev)版本[RuoYi-Vue3](https://gitcode.com/yangzongzhuan/RuoYi-Vue3),保持同步更新。
* 提供了单应用版本[RuoYi-Vue-fast](https://gitcode.com/yangzongzhuan/RuoYi-Vue-fast)Oracle版本[RuoYi-Vue-Oracle](https://gitcode.com/yangzongzhuan/RuoYi-Vue-Oracle),保持同步更新。
* 不分离版本,请移步[RuoYi](https://gitee.com/y_project/RuoYi),微服务版本,请移步[RuoYi-Cloud](https://gitee.com/y_project/RuoYi-Cloud)
* 感谢[Vue-Element-Admin](https://github.com/PanJiaChen/vue-element-admin)[eladmin-web](https://gitee.com/elunez/eladmin-web?_from=gitee_search)。
* 阿里云优惠券:[点我进入](https://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link),腾讯云优惠券:[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)&nbsp;&nbsp;
* 阿里云折扣场:[点我进入](http://aly.ruoyi.vip),腾讯云秒杀场:[点我进入](http://txy.ruoyi.vip)&nbsp;&nbsp;
## 内置功能
@ -27,8 +40,9 @@
13. 代码生成前后端代码的生成java、html、xml、sql支持CRUD下载 。
14. 系统接口根据业务代码自动生成相关的api接口文档。
15. 服务监控监视当前系统CPU、内存、磁盘、堆栈等相关信息。
16. 在线构建器拖动表单元素生成相应的HTML代码
17. 连接池监视监视当前系统数据库连接池状态可进行分析SQL找出系统性能瓶颈
16. 缓存监控:对系统的缓存信息查询,命令统计等
17. 在线构建器拖动表单元素生成相应的HTML代码
18. 连接池监视监视当前系统数据库连接池状态可进行分析SQL找出系统性能瓶颈。
## 在线体验
@ -71,11 +85,11 @@
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/b6115bc8c31de52951982e509930b20684a.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-6d73c2140ce694e3de4c05035fdc1868d4c.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-5e4daac0bb59612c5038448acbcef235e3a.png"/></td>
</tr>
</table>
## 若依前后端分离交流群
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群 [![加入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) [![加入QQ群](https://img.shields.io/badge/已满-264312783-blue.svg)](https://jq.qq.com/?_wv=1027&k=EI9an8lJ) [![加入QQ群](https://img.shields.io/badge/已满-167385320-blue.svg)](https://jq.qq.com/?_wv=1027&k=SWCtLnMz) [![加入QQ群](https://img.shields.io/badge/已满-104748341-blue.svg)](https://jq.qq.com/?_wv=1027&k=96Dkdq0k) [![加入QQ群](https://img.shields.io/badge/已满-160110482-blue.svg)](https://jq.qq.com/?_wv=1027&k=0fsNiYZt) [![加入QQ群](https://img.shields.io/badge/已满-170801498-blue.svg)](https://jq.qq.com/?_wv=1027&k=7xw4xUG1) [![加入QQ群](https://img.shields.io/badge/已满-108482800-blue.svg)](https://jq.qq.com/?_wv=1027&k=eCx8eyoJ) [![加入QQ群](https://img.shields.io/badge/已满-101046199-blue.svg)](https://jq.qq.com/?_wv=1027&k=SpyH2875) [![加入QQ群](https://img.shields.io/badge/已满-136919097-blue.svg)](https://jq.qq.com/?_wv=1027&k=tKEt51dz) [![加入QQ群](https://img.shields.io/badge/已满-143961921-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=0vBbSb0ztbBgVtn3kJS-Q4HUNYwip89G&authKey=8irq5PhutrZmWIvsUsklBxhj57l%2F1nOZqjzigkXZVoZE451GG4JHPOqW7AW6cf0T&noverify=0&group_code=143961921) [![加入QQ群](https://img.shields.io/badge/已满-174951577-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=ZFAPAbp09S2ltvwrJzp7wGlbopsc0rwi&authKey=HB2cxpxP2yspk%2Bo3WKTBfktRCccVkU26cgi5B16u0KcAYrVu7sBaE7XSEqmMdFQp&noverify=0&group_code=174951577) [![加入QQ群](https://img.shields.io/badge/已满-161281055-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=Fn2aF5IHpwsy8j6VlalNJK6qbwFLFHat&authKey=uyIT%2B97x2AXj3odyXpsSpVaPMC%2Bidw0LxG5MAtEqlrcBcWJUA%2FeS43rsF1Tg7IRJ&noverify=0&group_code=161281055) [![加入QQ群](https://img.shields.io/badge/已满-138988063-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=XIzkm_mV2xTsUtFxo63bmicYoDBA6Ifm&authKey=dDW%2F4qsmw3x9govoZY9w%2FoWAoC4wbHqGal%2BbqLzoS6VBarU8EBptIgPKN%2FviyC8j&noverify=0&group_code=138988063) [![加入QQ群](https://img.shields.io/badge/已满-151450850-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=DkugnCg68PevlycJSKSwjhFqfIgrWWwR&authKey=pR1Pa5lPIeGF%2FFtIk6d%2FGB5qFi0EdvyErtpQXULzo03zbhopBHLWcuqdpwY241R%2F&noverify=0&group_code=151450850) [![加入QQ群](https://img.shields.io/badge/已满-224622315-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=F58bgRa-Dp-rsQJThiJqIYv8t4-lWfXh&authKey=UmUs4CVG5OPA1whvsa4uSespOvyd8%2FAr9olEGaWAfdLmfKQk%2FVBp2YU3u2xXXt76&noverify=0&group_code=224622315) [![加入QQ群](https://img.shields.io/badge/已满-287842588-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=Nxb2EQ5qozWa218Wbs7zgBnjLSNk_tVT&authKey=obBKXj6SBKgrFTJZx0AqQnIYbNOvBB2kmgwWvGhzxR67RoRr84%2Bus5OadzMcdJl5&noverify=0&group_code=287842588) [![加入QQ群](https://img.shields.io/badge/已满-187944233-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=numtK1M_I4eVd2Gvg8qtbuL8JgX42qNh&authKey=giV9XWMaFZTY%2FqPlmWbkB9g3fi0Ev5CwEtT9Tgei0oUlFFCQLDp4ozWRiVIzubIm&noverify=0&group_code=187944233) [![加入QQ群](https://img.shields.io/badge/已满-228578329-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=G6r5KGCaa3pqdbUSXNIgYloyb8e0_L0D&authKey=4w8tF1eGW7%2FedWn%2FHAypQksdrML%2BDHolQSx7094Agm7Luakj9EbfPnSTxSi2T1LQ&noverify=0&group_code=228578329) [![加入QQ群](https://img.shields.io/badge/已满-191164766-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=GsOo-OLz53J8y_9TPoO6XXSGNRTgbFxA&authKey=R7Uy%2Feq%2BZsoKNqHvRKhiXpypW7DAogoWapOawUGHokJSBIBIre2%2FoiAZeZBSLuBc&noverify=0&group_code=191164766) [![加入QQ群](https://img.shields.io/badge/174569686-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=PmYavuzsOthVqfdAPbo4uAeIbu7Ttjgc&authKey=p52l8%2FXa4PS1JcEmS3VccKSwOPJUZ1ZfQ69MEKzbrooNUljRtlKjvsXf04bxNp3G&noverify=0&group_code=174569686) 点击按钮入群。

View File

@ -1,6 +1,6 @@
@echo off
echo.
echo [<5B><>Ϣ] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD>
echo [<5B><>Ϣ] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>target<EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
echo.
%~d0

View File

@ -1,6 +1,6 @@
@echo off
echo.
echo [<5B><>Ϣ] <20><><EFBFBD><EFBFBD>Web<65><62><EFBFBD>̡<EFBFBD>
echo [<5B><>Ϣ] ʹ<EFBFBD><EFBFBD>Jar<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Web<EFBFBD><EFBFBD><EFBFBD>̡<EFBFBD>
echo.
cd %~dp0

Binary file not shown.

180
pom.xml
View File

@ -6,68 +6,121 @@
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId>
<version>3.2.0</version>
<version>3.9.0</version>
<name>ruoyi</name>
<url>http://www.ruoyi.vip</url>
<description>若依管理系统</description>
<properties>
<ruoyi.version>3.2.0</ruoyi.version>
<ruoyi.version>3.9.0</ruoyi.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<mybatis.boot.version>1.3.2</mybatis.boot.version>
<druid.version>1.2.1</druid.version>
<bitwalker.version>1.19</bitwalker.version>
<swagger.version>2.9.2</swagger.version>
<kaptcha.version>2.3.2</kaptcha.version>
<pagehelper.boot.version>1.2.5</pagehelper.boot.version>
<fastjson.version>1.2.74</fastjson.version>
<oshi.version>5.2.5</oshi.version>
<jna.version>5.5.0</jna.version>
<commons.io.version>2.5</commons.io.version>
<commons.fileupload.version>1.3.3</commons.fileupload.version>
<poi.version>3.17</poi.version>
<velocity.version>1.7</velocity.version>
<spring-boot.version>2.5.15</spring-boot.version>
<druid.version>1.2.23</druid.version>
<bitwalker.version>1.21</bitwalker.version>
<swagger.version>3.0.0</swagger.version>
<kaptcha.version>2.3.3</kaptcha.version>
<pagehelper.boot.version>1.4.7</pagehelper.boot.version>
<fastjson.version>2.0.58</fastjson.version>
<oshi.version>6.8.3</oshi.version>
<commons.io.version>2.19.0</commons.io.version>
<poi.version>4.1.2</poi.version>
<velocity.version>2.3</velocity.version>
<jwt.version>0.9.1</jwt.version>
<!-- override dependency version -->
<tomcat.version>9.0.112</tomcat.version>
<logback.version>1.2.13</logback.version>
<spring-security.version>5.7.14</spring-security.version>
<spring-framework.version>5.3.39</spring-framework.version>
</properties>
<!-- 依赖声明 -->
<dependencyManagement>
<dependencies>
<!-- 覆盖SpringFramework的依赖配置-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>${spring-framework.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- 覆盖SpringSecurity的依赖配置-->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-bom</artifactId>
<version>${spring-security.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- SpringBoot的依赖配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.1.17.RELEASE</version>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!--阿里数据库连接池 -->
<!-- 覆盖logback的依赖配置-->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<!-- 覆盖tomcat的依赖配置-->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-el</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-websocket</artifactId>
<version>${tomcat.version}</version>
</dependency>
<!-- 阿里数据库连接池 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<!-- 解析客户端操作系统、浏览器等 -->
<dependency>
<groupId>eu.bitwalker</groupId>
<artifactId>UserAgentUtils</artifactId>
<version>${bitwalker.version}</version>
</dependency>
<!-- pagehelper 分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper.boot.version}</version>
</dependency>
<!-- 获取系统信息 -->
<dependency>
<groupId>com.github.oshi</groupId>
@ -75,119 +128,89 @@
<version>${oshi.version}</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>${jna.version}</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna-platform</artifactId>
<version>${jna.version}</version>
</dependency>
<!-- swagger2-->
<!-- Swagger3依赖 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<artifactId>springfox-boot-starter</artifactId>
<version>${swagger.version}</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- swagger2-UI-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
</dependency>
<!--io常用工具类 -->
<!-- io常用工具类 -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
<!--文件上传工具类 -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${commons.fileupload.version}</version>
</dependency>
<!-- excel工具 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
<!--velocity代码生成使用模板 -->
<!-- velocity代码生成使用模板 -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<artifactId>velocity-engine-core</artifactId>
<version>${velocity.version}</version>
</dependency>
<!-- 阿里JSON解析器 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!--Token生成与解析-->
<!-- Token生成与解析-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>${jwt.version}</version>
</dependency>
<!--验证码 -->
<!-- 验证码 -->
<dependency>
<groupId>com.github.penggle</groupId>
<groupId>pro.fessional</groupId>
<artifactId>kaptcha</artifactId>
<version>${kaptcha.version}</version>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-quartz</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-generator</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 系统模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
@ -208,11 +231,6 @@
</modules>
<packaging>pom</packaging>
<dependencies>
</dependencies>
<build>
<plugins>
<plugin>
@ -232,7 +250,7 @@
<repository>
<id>public</id>
<name>aliyun nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
@ -243,7 +261,7 @@
<pluginRepository>
<id>public</id>
<name>aliyun nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.2.0</version>
<version>3.9.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
@ -24,29 +24,17 @@
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<!-- swagger2-->
<!-- swagger3-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
</dependency>
<!--防止进入swagger页面报类型转换错误排除2.9.2中的引用手动增加1.5.21版本-->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.21</version>
<artifactId>springfox-boot-starter</artifactId>
</dependency>
<!-- 防止进入swagger页面报类型转换错误排除3.0.0中的引用手动增加1.6.2版本 -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.5.21</version>
</dependency>
<!-- swagger2-UI-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>1.6.2</version>
</dependency>
<!-- Mysql驱动包 -->
@ -80,7 +68,7 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.1.1.RELEASE</version>
<version>2.5.15</version>
<configuration>
<fork>true</fork> <!-- 如果没有该配置devtools不会生效 -->
</configuration>

View File

@ -7,16 +7,18 @@ import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
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;
import com.google.code.kaptcha.Producer;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.sign.Base64;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.system.service.ISysConfigService;
/**
* 验证码操作处理
@ -35,24 +37,31 @@ public class CaptchaController
@Autowired
private RedisCache redisCache;
// 验证码类型
@Value("${ruoyi.captchaType}")
private String captchaType;
@Autowired
private ISysConfigService configService;
/**
* 生成验证码
*/
@GetMapping("/captchaImage")
public AjaxResult getCode(HttpServletResponse response) throws IOException
{
AjaxResult ajax = AjaxResult.success();
boolean captchaEnabled = configService.selectCaptchaEnabled();
ajax.put("captchaEnabled", captchaEnabled);
if (!captchaEnabled)
{
return ajax;
}
// 保存验证码信息
String uuid = IdUtils.simpleUUID();
String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
String capStr = null, code = null;
BufferedImage image = null;
// 生成验证码
String captchaType = RuoYiConfig.getCaptchaType();
if ("math".equals(captchaType))
{
String capText = captchaProducerMath.createText();
@ -78,7 +87,6 @@ public class CaptchaController
return AjaxResult.error(e.getMessage());
}
AjaxResult ajax = AjaxResult.success();
ajax.put("uuid", uuid);
ajax.put("img", Base64.encode(os.toByteArray()));
return ajax;

View File

@ -1,16 +1,19 @@
package com.ruoyi.web.controller.common;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
@ -23,6 +26,7 @@ import com.ruoyi.framework.config.ServerConfig;
* @author ruoyi
*/
@RestController
@RequestMapping("/common")
public class CommonController
{
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
@ -30,28 +34,28 @@ public class CommonController
@Autowired
private ServerConfig serverConfig;
private static final String FILE_DELIMITER = ",";
/**
* 通用下载请求
*
* @param fileName 文件名称
* @param delete 是否删除
*/
@GetMapping("common/download")
@GetMapping("/download")
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
{
try
{
if (!FileUtils.isValidFilename(fileName))
if (!FileUtils.checkAllowDownload(fileName))
{
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
}
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
String filePath = RuoYiConfig.getDownloadPath() + fileName;
response.setCharacterEncoding("utf-8");
response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition",
"attachment;fileName=" + FileUtils.setFileDownloadHeader(request, realFileName));
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, realFileName);
FileUtils.writeBytes(filePath, response.getOutputStream());
if (delete)
{
@ -65,9 +69,9 @@ public class CommonController
}
/**
* 通用上传请求
* 通用上传请求(单个)
*/
@PostMapping("/common/upload")
@PostMapping("/upload")
public AjaxResult uploadFile(MultipartFile file) throws Exception
{
try
@ -78,8 +82,47 @@ public class CommonController
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
AjaxResult ajax = AjaxResult.success();
ajax.put("fileName", fileName);
ajax.put("url", url);
ajax.put("fileName", fileName);
ajax.put("newFileName", FileUtils.getName(fileName));
ajax.put("originalFilename", file.getOriginalFilename());
return ajax;
}
catch (Exception e)
{
return AjaxResult.error(e.getMessage());
}
}
/**
* 通用上传请求(多个)
*/
@PostMapping("/uploads")
public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception
{
try
{
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
List<String> urls = new ArrayList<String>();
List<String> fileNames = new ArrayList<String>();
List<String> newFileNames = new ArrayList<String>();
List<String> originalFilenames = new ArrayList<String>();
for (MultipartFile file : files)
{
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
urls.add(url);
fileNames.add(fileName);
newFileNames.add(FileUtils.getName(fileName));
originalFilenames.add(file.getOriginalFilename());
}
AjaxResult ajax = AjaxResult.success();
ajax.put("urls", StringUtils.join(urls, FILE_DELIMITER));
ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMITER));
ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMITER));
ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMITER));
return ajax;
}
catch (Exception e)
@ -91,19 +134,29 @@ public class CommonController
/**
* 本地资源通用下载
*/
@GetMapping("/common/download/resource")
public void resourceDownload(String name, HttpServletRequest request, HttpServletResponse response) throws Exception
@GetMapping("/download/resource")
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
throws Exception
{
// 本地资源路径
String localPath = RuoYiConfig.getProfile();
// 数据库资源地址
String downloadPath = localPath + StringUtils.substringAfter(name, Constants.RESOURCE_PREFIX);
// 下载名称
String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
response.setCharacterEncoding("utf-8");
response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition",
"attachment;fileName=" + FileUtils.setFileDownloadHeader(request, downloadName));
FileUtils.writeBytes(downloadPath, response.getOutputStream());
try
{
if (!FileUtils.checkAllowDownload(resource))
{
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
}
// 本地资源路径
String localPath = RuoYiConfig.getProfile();
// 数据库资源地址
String downloadPath = localPath + FileUtils.stripPrefix(resource);
// 下载名称
String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, downloadName);
FileUtils.writeBytes(downloadPath, response.getOutputStream());
}
catch (Exception e)
{
log.error("下载文件失败", e);
}
}
}

View File

@ -0,0 +1,121 @@
package com.ruoyi.web.controller.monitor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.RedisTemplate;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.SysCache;
/**
* 缓存监控
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/cache")
public class CacheController
{
@Autowired
private RedisTemplate<String, String> redisTemplate;
private final static List<SysCache> caches = new ArrayList<SysCache>();
{
caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "用户信息"));
caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "配置信息"));
caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "数据字典"));
caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "验证码"));
caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交"));
caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理"));
caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数"));
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping()
public AjaxResult getInfo() throws Exception
{
Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info());
Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats"));
Object dbSize = redisTemplate.execute((RedisCallback<Object>) connection -> connection.dbSize());
Map<String, Object> result = new HashMap<>(3);
result.put("info", info);
result.put("dbSize", dbSize);
List<Map<String, String>> pieList = new ArrayList<>();
commandStats.stringPropertyNames().forEach(key -> {
Map<String, String> data = new HashMap<>(2);
String property = commandStats.getProperty(key);
data.put("name", StringUtils.removeStart(key, "cmdstat_"));
data.put("value", StringUtils.substringBetween(property, "calls=", ",usec"));
pieList.add(data);
});
result.put("commandStats", pieList);
return AjaxResult.success(result);
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping("/getNames")
public AjaxResult cache()
{
return AjaxResult.success(caches);
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping("/getKeys/{cacheName}")
public AjaxResult getCacheKeys(@PathVariable String cacheName)
{
Set<String> cacheKeys = redisTemplate.keys(cacheName + "*");
return AjaxResult.success(new TreeSet<>(cacheKeys));
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping("/getValue/{cacheName}/{cacheKey}")
public AjaxResult getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey)
{
String cacheValue = redisTemplate.opsForValue().get(cacheKey);
SysCache sysCache = new SysCache(cacheName, cacheKey, cacheValue);
return AjaxResult.success(sysCache);
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@DeleteMapping("/clearCacheName/{cacheName}")
public AjaxResult clearCacheName(@PathVariable String cacheName)
{
Collection<String> cacheKeys = redisTemplate.keys(cacheName + "*");
redisTemplate.delete(cacheKeys);
return AjaxResult.success();
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@DeleteMapping("/clearCacheKey/{cacheKey}")
public AjaxResult clearCacheKey(@PathVariable String cacheKey)
{
redisTemplate.delete(cacheKey);
return AjaxResult.success();
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@DeleteMapping("/clearCacheAll")
public AjaxResult clearCacheAll()
{
Collection<String> cacheKeys = redisTemplate.keys("*");
redisTemplate.delete(cacheKeys);
return AjaxResult.success();
}
}

View File

@ -4,7 +4,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.framework.web.domain.Server;
@ -15,7 +14,7 @@ import com.ruoyi.framework.web.domain.Server;
*/
@RestController
@RequestMapping("/monitor/server")
public class ServerController extends BaseController
public class ServerController
{
@PreAuthorize("@ss.hasPermi('monitor:server:list')")
@GetMapping()

View File

@ -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;
@ -14,6 +16,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.service.SysPasswordService;
import com.ruoyi.system.domain.SysLogininfor;
import com.ruoyi.system.service.ISysLogininforService;
@ -29,6 +32,9 @@ public class SysLogininforController extends BaseController
@Autowired
private ISysLogininforService logininforService;
@Autowired
private SysPasswordService passwordService;
@PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
@GetMapping("/list")
public TableDataInfo list(SysLogininfor logininfor)
@ -40,12 +46,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<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
return util.exportExcel(list, "登录日志");
util.exportExcel(response, list, "登录日志");
}
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
@ -62,6 +68,15 @@ public class SysLogininforController extends BaseController
public AjaxResult clean()
{
logininforService.cleanLogininfor();
return AjaxResult.success();
return success();
}
@PreAuthorize("@ss.hasPermi('monitor:logininfor:unlock')")
@Log(title = "账户解锁", businessType = BusinessType.OTHER)
@GetMapping("/unlock/{userName}")
public AjaxResult unlock(@PathVariable("userName") String userName)
{
passwordService.clearLoginRecordCache(userName);
return success();
}
}

View File

@ -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,14 +42,15 @@ 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<SysOperLog> list = operLogService.selectOperLogList(operLog);
ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
return util.exportExcel(list, "操作日志");
util.exportExcel(response, list, "操作日志");
}
@Log(title = "操作日志", businessType = BusinessType.DELETE)
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
@DeleteMapping("/{operIds}")
public AjaxResult remove(@PathVariable Long[] operIds)
@ -61,6 +64,6 @@ public class SysOperlogController extends BaseController
public AjaxResult clean()
{
operLogService.cleanOperLog();
return AjaxResult.success();
return success();
}
}

View File

@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.LoginUser;
@ -42,31 +42,22 @@ public class SysUserOnlineController extends BaseController
@GetMapping("/list")
public TableDataInfo list(String ipaddr, String userName)
{
Collection<String> keys = redisCache.keys(Constants.LOGIN_TOKEN_KEY + "*");
Collection<String> keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*");
List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>();
for (String key : keys)
{
LoginUser user = redisCache.getCacheObject(key);
if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName))
{
if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername()))
{
userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user));
}
userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user));
}
else if (StringUtils.isNotEmpty(ipaddr))
{
if (StringUtils.equals(ipaddr, user.getIpaddr()))
{
userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user));
}
userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user));
}
else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser()))
{
if (StringUtils.equals(userName, user.getUsername()))
{
userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user));
}
userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user));
}
else
{
@ -86,7 +77,7 @@ public class SysUserOnlineController extends BaseController
@DeleteMapping("/{tokenId}")
public AjaxResult forceLogout(@PathVariable String tokenId)
{
redisCache.deleteObject(Constants.LOGIN_TOKEN_KEY + tokenId);
return AjaxResult.success();
redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId);
return success();
}
}

View File

@ -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,13 +14,10 @@ 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;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.SysConfig;
import com.ruoyi.system.service.ISysConfigService;
@ -50,12 +48,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<SysConfig> list = configService.selectConfigList(config);
ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
return util.exportExcel(list, "参数数据");
util.exportExcel(response, list, "参数数据");
}
/**
@ -65,7 +63,7 @@ public class SysConfigController extends BaseController
@GetMapping(value = "/{configId}")
public AjaxResult getInfo(@PathVariable Long configId)
{
return AjaxResult.success(configService.selectConfigById(configId));
return success(configService.selectConfigById(configId));
}
/**
@ -74,7 +72,7 @@ public class SysConfigController extends BaseController
@GetMapping(value = "/configKey/{configKey}")
public AjaxResult getConfigKey(@PathVariable String configKey)
{
return AjaxResult.success(configService.selectConfigByKey(configKey));
return success(configService.selectConfigByKey(configKey));
}
/**
@ -83,14 +81,13 @@ 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)))
if (!configService.checkConfigKeyUnique(config))
{
return AjaxResult.error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
}
config.setCreateBy(SecurityUtils.getUsername());
config.setCreateBy(getUsername());
return toAjax(configService.insertConfig(config));
}
@ -102,11 +99,11 @@ public class SysConfigController extends BaseController
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysConfig config)
{
if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
if (!configService.checkConfigKeyUnique(config))
{
return AjaxResult.error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
}
config.setUpdateBy(SecurityUtils.getUsername());
config.setUpdateBy(getUsername());
return toAjax(configService.updateConfig(config));
}
@ -118,18 +115,19 @@ public class SysConfigController extends BaseController
@DeleteMapping("/{configIds}")
public AjaxResult remove(@PathVariable Long[] configIds)
{
return toAjax(configService.deleteConfigByIds(configIds));
configService.deleteConfigByIds(configIds);
return success();
}
/**
* 清空缓存
* 刷新参数缓存
*/
@PreAuthorize("@ss.hasPermi('system:config:remove')")
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
@DeleteMapping("/clearCache")
public AjaxResult clearCache()
@DeleteMapping("/refreshCache")
public AjaxResult refreshCache()
{
configService.clearCache();
return AjaxResult.success();
configService.resetConfigCache();
return success();
}
}

View File

@ -1,6 +1,5 @@
package com.ruoyi.web.controller.system;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -20,7 +19,6 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysDeptService;
@ -44,7 +42,7 @@ public class SysDeptController extends BaseController
public AjaxResult list(SysDept dept)
{
List<SysDept> depts = deptService.selectDeptList(dept);
return AjaxResult.success(depts);
return success(depts);
}
/**
@ -55,17 +53,8 @@ public class SysDeptController extends BaseController
public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
{
List<SysDept> depts = deptService.selectDeptList(new SysDept());
Iterator<SysDept> it = depts.iterator();
while (it.hasNext())
{
SysDept d = (SysDept) it.next();
if (d.getDeptId().intValue() == deptId
|| ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""))
{
it.remove();
}
}
return AjaxResult.success(depts);
depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""));
return success(depts);
}
/**
@ -75,30 +64,8 @@ public class SysDeptController extends BaseController
@GetMapping(value = "/{deptId}")
public AjaxResult getInfo(@PathVariable Long deptId)
{
return AjaxResult.success(deptService.selectDeptById(deptId));
}
/**
* 获取部门下拉树列表
*/
@GetMapping("/treeselect")
public AjaxResult treeselect(SysDept dept)
{
List<SysDept> depts = deptService.selectDeptList(dept);
return AjaxResult.success(deptService.buildDeptTreeSelect(depts));
}
/**
* 加载对应角色部门列表树
*/
@GetMapping(value = "/roleDeptTreeselect/{roleId}")
public AjaxResult roleDeptTreeselect(@PathVariable("roleId") Long roleId)
{
List<SysDept> depts = deptService.selectDeptList(new SysDept());
AjaxResult ajax = AjaxResult.success();
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
ajax.put("depts", deptService.buildDeptTreeSelect(depts));
return ajax;
deptService.checkDeptDataScope(deptId);
return success(deptService.selectDeptById(deptId));
}
/**
@ -109,11 +76,11 @@ public class SysDeptController extends BaseController
@PostMapping
public AjaxResult add(@Validated @RequestBody SysDept dept)
{
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
if (!deptService.checkDeptNameUnique(dept))
{
return AjaxResult.error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
}
dept.setCreateBy(SecurityUtils.getUsername());
dept.setCreateBy(getUsername());
return toAjax(deptService.insertDept(dept));
}
@ -125,20 +92,21 @@ public class SysDeptController extends BaseController
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysDept dept)
{
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
Long deptId = dept.getDeptId();
deptService.checkDeptDataScope(deptId);
if (!deptService.checkDeptNameUnique(dept))
{
return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
}
else if (dept.getParentId().equals(dept.getDeptId()))
else if (dept.getParentId().equals(deptId))
{
return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
}
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus())
&& deptService.selectNormalChildrenDeptById(dept.getDeptId()) > 0)
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0)
{
return AjaxResult.error("该部门包含未停用的子部门!");
return error("该部门包含未停用的子部门!");
}
dept.setUpdateBy(SecurityUtils.getUsername());
dept.setUpdateBy(getUsername());
return toAjax(deptService.updateDept(dept));
}
@ -152,12 +120,13 @@ public class SysDeptController extends BaseController
{
if (deptService.hasChildByDeptId(deptId))
{
return AjaxResult.error("存在下级部门,不允许删除");
return warn("存在下级部门,不允许删除");
}
if (deptService.checkDeptExistUser(deptId))
{
return AjaxResult.error("部门存在用户,不允许删除");
return warn("部门存在用户,不允许删除");
}
deptService.checkDeptDataScope(deptId);
return toAjax(deptService.deleteDeptById(deptId));
}
}

View File

@ -1,6 +1,8 @@
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;
@ -18,7 +20,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysDictDataService;
import com.ruoyi.system.service.ISysDictTypeService;
@ -49,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<SysDictData> list = dictDataService.selectDictDataList(dictData);
ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
return util.exportExcel(list, "字典数据");
util.exportExcel(response, list, "字典数据");
}
/**
@ -64,7 +66,7 @@ public class SysDictDataController extends BaseController
@GetMapping(value = "/{dictCode}")
public AjaxResult getInfo(@PathVariable Long dictCode)
{
return AjaxResult.success(dictDataService.selectDictDataById(dictCode));
return success(dictDataService.selectDictDataById(dictCode));
}
/**
@ -73,7 +75,12 @@ public class SysDictDataController extends BaseController
@GetMapping(value = "/type/{dictType}")
public AjaxResult dictType(@PathVariable String dictType)
{
return AjaxResult.success(dictTypeService.selectDictDataByType(dictType));
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
if (StringUtils.isNull(data))
{
data = new ArrayList<SysDictData>();
}
return success(data);
}
/**
@ -84,7 +91,7 @@ public class SysDictDataController extends BaseController
@PostMapping
public AjaxResult add(@Validated @RequestBody SysDictData dict)
{
dict.setCreateBy(SecurityUtils.getUsername());
dict.setCreateBy(getUsername());
return toAjax(dictDataService.insertDictData(dict));
}
@ -96,7 +103,7 @@ public class SysDictDataController extends BaseController
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysDictData dict)
{
dict.setUpdateBy(SecurityUtils.getUsername());
dict.setUpdateBy(getUsername());
return toAjax(dictDataService.updateDictData(dict));
}
@ -108,6 +115,7 @@ public class SysDictDataController extends BaseController
@DeleteMapping("/{dictCodes}")
public AjaxResult remove(@PathVariable Long[] dictCodes)
{
return toAjax(dictDataService.deleteDictDataByIds(dictCodes));
dictDataService.deleteDictDataByIds(dictCodes);
return success();
}
}

View File

@ -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,13 +14,11 @@ 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.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictType;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysDictTypeService;
@ -46,12 +45,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<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
return util.exportExcel(list, "字典类型");
util.exportExcel(response, list, "字典类型");
}
/**
@ -61,7 +60,7 @@ public class SysDictTypeController extends BaseController
@GetMapping(value = "/{dictId}")
public AjaxResult getInfo(@PathVariable Long dictId)
{
return AjaxResult.success(dictTypeService.selectDictTypeById(dictId));
return success(dictTypeService.selectDictTypeById(dictId));
}
/**
@ -72,11 +71,11 @@ public class SysDictTypeController extends BaseController
@PostMapping
public AjaxResult add(@Validated @RequestBody SysDictType dict)
{
if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
if (!dictTypeService.checkDictTypeUnique(dict))
{
return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
}
dict.setCreateBy(SecurityUtils.getUsername());
dict.setCreateBy(getUsername());
return toAjax(dictTypeService.insertDictType(dict));
}
@ -88,11 +87,11 @@ public class SysDictTypeController extends BaseController
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysDictType dict)
{
if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
if (!dictTypeService.checkDictTypeUnique(dict))
{
return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
}
dict.setUpdateBy(SecurityUtils.getUsername());
dict.setUpdateBy(getUsername());
return toAjax(dictTypeService.updateDictType(dict));
}
@ -104,19 +103,20 @@ public class SysDictTypeController extends BaseController
@DeleteMapping("/{dictIds}")
public AjaxResult remove(@PathVariable Long[] dictIds)
{
return toAjax(dictTypeService.deleteDictTypeByIds(dictIds));
dictTypeService.deleteDictTypeByIds(dictIds);
return success();
}
/**
* 清空缓存
* 刷新字典缓存
*/
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
@DeleteMapping("/clearCache")
public AjaxResult clearCache()
@DeleteMapping("/refreshCache")
public AjaxResult refreshCache()
{
dictTypeService.clearCache();
return AjaxResult.success();
dictTypeService.resetDictCache();
return success();
}
/**
@ -126,6 +126,6 @@ public class SysDictTypeController extends BaseController
public AjaxResult optionselect()
{
List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
return AjaxResult.success(dictTypes);
return success(dictTypes);
}
}

View File

@ -0,0 +1,29 @@
package com.ruoyi.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.utils.StringUtils;
/**
* 首页
*
* @author ruoyi
*/
@RestController
public class SysIndexController
{
/** 系统基础配置 */
@Autowired
private RuoYiConfig ruoyiConfig;
/**
* 访问首页,提示语
*/
@RequestMapping("/")
public String index()
{
return StringUtils.format("欢迎使用{}后台管理框架当前版本v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion());
}
}

View File

@ -1,5 +1,6 @@
package com.ruoyi.web.controller.system;
import java.util.Date;
import java.util.List;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
@ -13,10 +14,14 @@ import com.ruoyi.common.core.domain.entity.SysMenu;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginBody;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.web.service.SysLoginService;
import com.ruoyi.framework.web.service.SysPermissionService;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysMenuService;
/**
@ -39,6 +44,9 @@ public class SysLoginController
@Autowired
private TokenService tokenService;
@Autowired
private ISysConfigService configService;
/**
* 登录方法
*
@ -64,16 +72,23 @@ public class SysLoginController
@GetMapping("getInfo")
public AjaxResult getInfo()
{
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
// 角色集合
Set<String> roles = permissionService.getRolePermission(user);
// 权限集合
Set<String> permissions = permissionService.getMenuPermission(user);
if (!loginUser.getPermissions().equals(permissions))
{
loginUser.setPermissions(permissions);
tokenService.refreshToken(loginUser);
}
AjaxResult ajax = AjaxResult.success();
ajax.put("user", user);
ajax.put("roles", roles);
ajax.put("permissions", permissions);
ajax.put("isDefaultModifyPwd", initPasswordIsModify(user.getPwdUpdateDate()));
ajax.put("isPasswordExpired", passwordIsExpiration(user.getPwdUpdateDate()));
return ajax;
}
@ -85,10 +100,32 @@ public class SysLoginController
@GetMapping("getRouters")
public AjaxResult getRouters()
{
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
// 用户信息
SysUser user = loginUser.getUser();
List<SysMenu> menus = menuService.selectMenuTreeByUserId(user.getUserId());
Long userId = SecurityUtils.getUserId();
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
return AjaxResult.success(menuService.buildMenus(menus));
}
// 检查初始密码是否提醒修改
public boolean initPasswordIsModify(Date pwdUpdateDate)
{
Integer initPasswordModify = Convert.toInt(configService.selectConfigByKey("sys.account.initPasswordModify"));
return initPasswordModify != null && initPasswordModify == 1 && pwdUpdateDate == null;
}
// 检查密码是否过期
public boolean passwordIsExpiration(Date pwdUpdateDate)
{
Integer passwordValidateDays = Convert.toInt(configService.selectConfigByKey("sys.account.passwordValidateDays"));
if (passwordValidateDays != null && passwordValidateDays > 0)
{
if (StringUtils.isNull(pwdUpdateDate))
{
// 如果从未修改过初始密码,直接提醒过期
return true;
}
Date nowDate = DateUtils.getNowDate();
return DateUtils.differentDaysByMillisecond(nowDate, pwdUpdateDate) > passwordValidateDays;
}
return false;
}
}

View File

@ -13,17 +13,12 @@ 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.constant.Constants;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysMenu;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.service.ISysMenuService;
/**
@ -38,9 +33,6 @@ public class SysMenuController extends BaseController
@Autowired
private ISysMenuService menuService;
@Autowired
private TokenService tokenService;
/**
* 获取菜单列表
*/
@ -48,10 +40,8 @@ public class SysMenuController extends BaseController
@GetMapping("/list")
public AjaxResult list(SysMenu menu)
{
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
Long userId = loginUser.getUser().getUserId();
List<SysMenu> menus = menuService.selectMenuList(menu, userId);
return AjaxResult.success(menus);
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
return success(menus);
}
/**
@ -61,7 +51,7 @@ public class SysMenuController extends BaseController
@GetMapping(value = "/{menuId}")
public AjaxResult getInfo(@PathVariable Long menuId)
{
return AjaxResult.success(menuService.selectMenuById(menuId));
return success(menuService.selectMenuById(menuId));
}
/**
@ -70,10 +60,8 @@ public class SysMenuController extends BaseController
@GetMapping("/treeselect")
public AjaxResult treeselect(SysMenu menu)
{
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
Long userId = loginUser.getUser().getUserId();
List<SysMenu> menus = menuService.selectMenuList(menu, userId);
return AjaxResult.success(menuService.buildMenuTreeSelect(menus));
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
return success(menuService.buildMenuTreeSelect(menus));
}
/**
@ -82,8 +70,7 @@ public class SysMenuController extends BaseController
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId)
{
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
List<SysMenu> menus = menuService.selectMenuList(loginUser.getUser().getUserId());
List<SysMenu> menus = menuService.selectMenuList(getUserId());
AjaxResult ajax = AjaxResult.success();
ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
ajax.put("menus", menuService.buildMenuTreeSelect(menus));
@ -98,16 +85,15 @@ public class SysMenuController extends BaseController
@PostMapping
public AjaxResult add(@Validated @RequestBody SysMenu menu)
{
if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu)))
if (!menuService.checkMenuNameUnique(menu))
{
return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
}
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame())
&& !StringUtils.startsWithAny(menu.getPath(), Constants.HTTP, Constants.HTTPS))
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
{
return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败地址必须以http(s)://开头");
return error("新增菜单'" + menu.getMenuName() + "'失败地址必须以http(s)://开头");
}
menu.setCreateBy(SecurityUtils.getUsername());
menu.setCreateBy(getUsername());
return toAjax(menuService.insertMenu(menu));
}
@ -119,20 +105,19 @@ public class SysMenuController extends BaseController
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysMenu menu)
{
if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu)))
if (!menuService.checkMenuNameUnique(menu))
{
return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
}
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame())
&& !StringUtils.startsWithAny(menu.getPath(), Constants.HTTP, Constants.HTTPS))
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
{
return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败地址必须以http(s)://开头");
return error("修改菜单'" + menu.getMenuName() + "'失败地址必须以http(s)://开头");
}
else if (menu.getMenuId().equals(menu.getParentId()))
{
return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
return error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
}
menu.setUpdateBy(SecurityUtils.getUsername());
menu.setUpdateBy(getUsername());
return toAjax(menuService.updateMenu(menu));
}
@ -146,11 +131,11 @@ public class SysMenuController extends BaseController
{
if (menuService.hasChildByMenuId(menuId))
{
return AjaxResult.error("存在子菜单,不允许删除");
return warn("存在子菜单,不允许删除");
}
if (menuService.checkMenuExistRole(menuId))
{
return AjaxResult.error("菜单已分配,不允许删除");
return warn("菜单已分配,不允许删除");
}
return toAjax(menuService.deleteMenuById(menuId));
}

View File

@ -17,7 +17,6 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.domain.SysNotice;
import com.ruoyi.system.service.ISysNoticeService;
@ -52,7 +51,7 @@ public class SysNoticeController extends BaseController
@GetMapping(value = "/{noticeId}")
public AjaxResult getInfo(@PathVariable Long noticeId)
{
return AjaxResult.success(noticeService.selectNoticeById(noticeId));
return success(noticeService.selectNoticeById(noticeId));
}
/**
@ -63,7 +62,7 @@ public class SysNoticeController extends BaseController
@PostMapping
public AjaxResult add(@Validated @RequestBody SysNotice notice)
{
notice.setCreateBy(SecurityUtils.getUsername());
notice.setCreateBy(getUsername());
return toAjax(noticeService.insertNotice(notice));
}
@ -75,7 +74,7 @@ public class SysNoticeController extends BaseController
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysNotice notice)
{
notice.setUpdateBy(SecurityUtils.getUsername());
notice.setUpdateBy(getUsername());
return toAjax(noticeService.updateNotice(notice));
}

View File

@ -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,12 +14,10 @@ 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.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.SysPost;
import com.ruoyi.system.service.ISysPostService;
@ -49,12 +48,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<SysPost> list = postService.selectPostList(post);
ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
return util.exportExcel(list, "岗位数据");
util.exportExcel(response, list, "岗位数据");
}
/**
@ -64,7 +63,7 @@ public class SysPostController extends BaseController
@GetMapping(value = "/{postId}")
public AjaxResult getInfo(@PathVariable Long postId)
{
return AjaxResult.success(postService.selectPostById(postId));
return success(postService.selectPostById(postId));
}
/**
@ -75,15 +74,15 @@ public class SysPostController extends BaseController
@PostMapping
public AjaxResult add(@Validated @RequestBody SysPost post)
{
if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
if (!postService.checkPostNameUnique(post))
{
return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
}
else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post)))
else if (!postService.checkPostCodeUnique(post))
{
return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
}
post.setCreateBy(SecurityUtils.getUsername());
post.setCreateBy(getUsername());
return toAjax(postService.insertPost(post));
}
@ -95,15 +94,15 @@ public class SysPostController extends BaseController
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysPost post)
{
if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
if (!postService.checkPostNameUnique(post))
{
return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
}
else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post)))
else if (!postService.checkPostCodeUnique(post))
{
return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
}
post.setUpdateBy(SecurityUtils.getUsername());
post.setUpdateBy(getUsername());
return toAjax(postService.updatePost(post));
}
@ -125,6 +124,6 @@ public class SysPostController extends BaseController
public AjaxResult optionselect()
{
List<SysPost> posts = postService.selectPostAll();
return AjaxResult.success(posts);
return success(posts);
}
}

View File

@ -1,6 +1,6 @@
package com.ruoyi.web.controller.system;
import java.io.IOException;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -17,9 +17,12 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.common.utils.file.MimeTypeUtils;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.service.ISysUserService;
@ -44,7 +47,7 @@ public class SysProfileController extends BaseController
@GetMapping
public AjaxResult profile()
{
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
LoginUser loginUser = getLoginUser();
SysUser user = loginUser.getUser();
AjaxResult ajax = AjaxResult.success(user);
ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
@ -59,18 +62,27 @@ public class SysProfileController extends BaseController
@PutMapping
public AjaxResult updateProfile(@RequestBody SysUser user)
{
if (userService.updateUserProfile(user) > 0)
LoginUser loginUser = getLoginUser();
SysUser currentUser = loginUser.getUser();
currentUser.setNickName(user.getNickName());
currentUser.setEmail(user.getEmail());
currentUser.setPhonenumber(user.getPhonenumber());
currentUser.setSex(user.getSex());
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser))
{
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
// 更新缓存用户信息
loginUser.getUser().setNickName(user.getNickName());
loginUser.getUser().setPhonenumber(user.getPhonenumber());
loginUser.getUser().setEmail(user.getEmail());
loginUser.getUser().setSex(user.getSex());
tokenService.setLoginUser(loginUser);
return AjaxResult.success();
return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在");
}
return AjaxResult.error("修改个人信息异常,请联系管理员");
if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser))
{
return error("修改用户'" + loginUser.getUsername() + "'失败,邮箱账号已存在");
}
if (userService.updateUserProfile(currentUser) > 0)
{
// 更新缓存用户信息
tokenService.setLoginUser(loginUser);
return success();
}
return error("修改个人信息异常,请联系管理员");
}
/**
@ -78,27 +90,32 @@ public class SysProfileController extends BaseController
*/
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
@PutMapping("/updatePwd")
public AjaxResult updatePwd(String oldPassword, String newPassword)
public AjaxResult updatePwd(@RequestBody Map<String, String> params)
{
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
String userName = loginUser.getUsername();
String password = loginUser.getPassword();
String oldPassword = params.get("oldPassword");
String newPassword = params.get("newPassword");
LoginUser loginUser = getLoginUser();
Long userId = loginUser.getUserId();
SysUser user = userService.selectUserById(userId);
String password = user.getPassword();
if (!SecurityUtils.matchesPassword(oldPassword, password))
{
return AjaxResult.error("修改密码失败,旧密码错误");
return error("修改密码失败,旧密码错误");
}
if (SecurityUtils.matchesPassword(newPassword, password))
{
return AjaxResult.error("新密码不能与旧密码相同");
return error("新密码不能与旧密码相同");
}
if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0)
newPassword = SecurityUtils.encryptPassword(newPassword);
if (userService.resetUserPwd(userId, newPassword) > 0)
{
// 更新缓存用户密码
loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword));
// 更新缓存用户密码&密码最后更新时间
loginUser.getUser().setPwdUpdateDate(DateUtils.getNowDate());
loginUser.getUser().setPassword(newPassword);
tokenService.setLoginUser(loginUser);
return AjaxResult.success();
return success();
}
return AjaxResult.error("修改密码异常,请联系管理员");
return error("修改密码异常,请联系管理员");
}
/**
@ -106,14 +123,19 @@ public class SysProfileController extends BaseController
*/
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
@PostMapping("/avatar")
public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws IOException
public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception
{
if (!file.isEmpty())
{
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file);
if (userService.updateUserAvatar(loginUser.getUsername(), avatar))
LoginUser loginUser = getLoginUser();
String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION, true);
if (userService.updateUserAvatar(loginUser.getUserId(), avatar))
{
String oldAvatar = loginUser.getUser().getAvatar();
if (StringUtils.isNotEmpty(oldAvatar))
{
FileUtils.deleteFile(RuoYiConfig.getProfile() + FileUtils.stripPrefix(oldAvatar));
}
AjaxResult ajax = AjaxResult.success();
ajax.put("imgUrl", avatar);
// 更新缓存用户头像
@ -122,6 +144,6 @@ public class SysProfileController extends BaseController
return ajax;
}
}
return AjaxResult.error("上传图片异常,请联系管理员");
return error("上传图片异常,请联系管理员");
}
}

View File

@ -0,0 +1,38 @@
package com.ruoyi.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.RegisterBody;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.web.service.SysRegisterService;
import com.ruoyi.system.service.ISysConfigService;
/**
* 注册验证
*
* @author ruoyi
*/
@RestController
public class SysRegisterController extends BaseController
{
@Autowired
private SysRegisterService registerService;
@Autowired
private ISysConfigService configService;
@PostMapping("/register")
public AjaxResult register(@RequestBody RegisterBody user)
{
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser"))))
{
return error("当前系统没有开启注册功能!");
}
String msg = registerService.register(user);
return StringUtils.isEmpty(msg) ? success() : error(msg);
}
}

View File

@ -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,19 +14,20 @@ 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.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.service.SysPermissionService;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.domain.SysUserRole;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService;
@ -43,13 +45,16 @@ public class SysRoleController extends BaseController
@Autowired
private TokenService tokenService;
@Autowired
private SysPermissionService permissionService;
@Autowired
private ISysUserService userService;
@Autowired
private ISysDeptService deptService;
@PreAuthorize("@ss.hasPermi('system:role:list')")
@GetMapping("/list")
public TableDataInfo list(SysRole role)
@ -61,12 +66,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<SysRole> list = roleService.selectRoleList(role);
ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
return util.exportExcel(list, "角色数据");
util.exportExcel(response, list, "角色数据");
}
/**
@ -76,7 +81,8 @@ public class SysRoleController extends BaseController
@GetMapping(value = "/{roleId}")
public AjaxResult getInfo(@PathVariable Long roleId)
{
return AjaxResult.success(roleService.selectRoleById(roleId));
roleService.checkRoleDataScope(roleId);
return success(roleService.selectRoleById(roleId));
}
/**
@ -87,15 +93,15 @@ public class SysRoleController extends BaseController
@PostMapping
public AjaxResult add(@Validated @RequestBody SysRole role)
{
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
if (!roleService.checkRoleNameUnique(role))
{
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
}
else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
else if (!roleService.checkRoleKeyUnique(role))
{
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
}
role.setCreateBy(SecurityUtils.getUsername());
role.setCreateBy(getUsername());
return toAjax(roleService.insertRole(role));
}
@ -109,29 +115,30 @@ public class SysRoleController extends BaseController
public AjaxResult edit(@Validated @RequestBody SysRole role)
{
roleService.checkRoleAllowed(role);
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
roleService.checkRoleDataScope(role.getRoleId());
if (!roleService.checkRoleNameUnique(role))
{
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
}
else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
else if (!roleService.checkRoleKeyUnique(role))
{
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
}
role.setUpdateBy(SecurityUtils.getUsername());
role.setUpdateBy(getUsername());
if (roleService.updateRole(role) > 0)
{
// 更新缓存用户权限
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
LoginUser loginUser = getLoginUser();
if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin())
{
loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
tokenService.setLoginUser(loginUser);
}
return AjaxResult.success();
return success();
}
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,请联系管理员");
return error("修改角色'" + role.getRoleName() + "'失败,请联系管理员");
}
/**
@ -143,6 +150,7 @@ public class SysRoleController extends BaseController
public AjaxResult dataScope(@RequestBody SysRole role)
{
roleService.checkRoleAllowed(role);
roleService.checkRoleDataScope(role.getRoleId());
return toAjax(roleService.authDataScope(role));
}
@ -155,7 +163,8 @@ public class SysRoleController extends BaseController
public AjaxResult changeStatus(@RequestBody SysRole role)
{
roleService.checkRoleAllowed(role);
role.setUpdateBy(SecurityUtils.getUsername());
roleService.checkRoleDataScope(role.getRoleId());
role.setUpdateBy(getUsername());
return toAjax(roleService.updateRoleStatus(role));
}
@ -177,6 +186,77 @@ public class SysRoleController extends BaseController
@GetMapping("/optionselect")
public AjaxResult optionselect()
{
return AjaxResult.success(roleService.selectRoleAll());
return success(roleService.selectRoleAll());
}
/**
* 查询已分配用户角色列表
*/
@PreAuthorize("@ss.hasPermi('system:role:list')")
@GetMapping("/authUser/allocatedList")
public TableDataInfo allocatedList(SysUser user)
{
startPage();
List<SysUser> list = userService.selectAllocatedList(user);
return getDataTable(list);
}
/**
* 查询未分配用户角色列表
*/
@PreAuthorize("@ss.hasPermi('system:role:list')")
@GetMapping("/authUser/unallocatedList")
public TableDataInfo unallocatedList(SysUser user)
{
startPage();
List<SysUser> list = userService.selectUnallocatedList(user);
return getDataTable(list);
}
/**
* 取消授权用户
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.GRANT)
@PutMapping("/authUser/cancel")
public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole)
{
return toAjax(roleService.deleteAuthUser(userRole));
}
/**
* 批量取消授权用户
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.GRANT)
@PutMapping("/authUser/cancelAll")
public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds)
{
return toAjax(roleService.deleteAuthUsers(roleId, userIds));
}
/**
* 批量选择用户授权
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.GRANT)
@PutMapping("/authUser/selectAll")
public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds)
{
roleService.checkRoleDataScope(roleId);
return toAjax(roleService.insertAuthUsers(roleId, userIds));
}
/**
* 获取对应角色部门树列表
*/
@PreAuthorize("@ss.hasPermi('system:role:query')")
@GetMapping(value = "/deptTree/{roleId}")
public AjaxResult deptTree(@PathVariable("roleId") Long roleId)
{
AjaxResult ajax = AjaxResult.success();
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
ajax.put("depts", deptService.selectDeptTreeList(new SysDept()));
return ajax;
}
}

View File

@ -2,6 +2,8 @@ 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;
import org.springframework.validation.annotation.Validated;
@ -15,19 +17,17 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysPostService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService;
@ -48,10 +48,10 @@ public class SysUserController extends BaseController
private ISysRoleService roleService;
@Autowired
private ISysPostService postService;
private ISysDeptService deptService;
@Autowired
private TokenService tokenService;
private ISysPostService postService;
/**
* 获取用户列表
@ -67,12 +67,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<SysUser> list = userService.selectUserList(user);
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
return util.exportExcel(list, "用户数据");
util.exportExcel(response, list, "用户数据");
}
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
@ -82,17 +82,16 @@ public class SysUserController extends BaseController
{
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
List<SysUser> userList = util.importExcel(file.getInputStream());
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
String operName = loginUser.getUsername();
String operName = getUsername();
String message = userService.importUser(userList, updateSupport, operName);
return AjaxResult.success(message);
return success(message);
}
@GetMapping("/importTemplate")
public AjaxResult importTemplate()
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response)
{
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
return util.importTemplateExcel("用户数据");
util.importTemplateExcel(response, "用户数据");
}
/**
@ -103,15 +102,17 @@ public class SysUserController extends BaseController
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
{
AjaxResult ajax = AjaxResult.success();
if (StringUtils.isNotNull(userId))
{
userService.checkUserDataScope(userId);
SysUser sysUser = 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()));
}
List<SysRole> roles = roleService.selectRoleAll();
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
ajax.put("posts", postService.selectPostAll());
if (StringUtils.isNotNull(userId))
{
ajax.put(AjaxResult.DATA_TAG, userService.selectUserById(userId));
ajax.put("postIds", postService.selectPostListByUserId(userId));
ajax.put("roleIds", roleService.selectRoleListByUserId(userId));
}
return ajax;
}
@ -123,19 +124,21 @@ public class SysUserController extends BaseController
@PostMapping
public AjaxResult add(@Validated @RequestBody SysUser user)
{
if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user.getUserName())))
deptService.checkDeptDataScope(user.getDeptId());
roleService.checkRoleDataScope(user.getRoleIds());
if (!userService.checkUserNameUnique(user))
{
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
}
else if (UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
{
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
}
else if (UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
{
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
}
user.setCreateBy(SecurityUtils.getUsername());
user.setCreateBy(getUsername());
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
return toAjax(userService.insertUser(user));
}
@ -149,15 +152,22 @@ public class SysUserController extends BaseController
public AjaxResult edit(@Validated @RequestBody SysUser user)
{
userService.checkUserAllowed(user);
if (UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
userService.checkUserDataScope(user.getUserId());
deptService.checkDeptDataScope(user.getDeptId());
roleService.checkRoleDataScope(user.getRoleIds());
if (!userService.checkUserNameUnique(user))
{
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在");
}
else if (UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
{
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
}
user.setUpdateBy(SecurityUtils.getUsername());
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
{
return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
}
user.setUpdateBy(getUsername());
return toAjax(userService.updateUser(user));
}
@ -169,20 +179,25 @@ public class SysUserController extends BaseController
@DeleteMapping("/{userIds}")
public AjaxResult remove(@PathVariable Long[] userIds)
{
if (ArrayUtils.contains(userIds, getUserId()))
{
return error("当前用户不能删除");
}
return toAjax(userService.deleteUserByIds(userIds));
}
/**
* 重置密码
*/
@PreAuthorize("@ss.hasPermi('system:user:edit')")
@PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PutMapping("/resetPwd")
public AjaxResult resetPwd(@RequestBody SysUser user)
{
userService.checkUserAllowed(user);
userService.checkUserDataScope(user.getUserId());
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
user.setUpdateBy(SecurityUtils.getUsername());
user.setUpdateBy(getUsername());
return toAjax(userService.resetPwd(user));
}
@ -195,7 +210,47 @@ public class SysUserController extends BaseController
public AjaxResult changeStatus(@RequestBody SysUser user)
{
userService.checkUserAllowed(user);
user.setUpdateBy(SecurityUtils.getUsername());
userService.checkUserDataScope(user.getUserId());
user.setUpdateBy(getUsername());
return toAjax(userService.updateUserStatus(user));
}
/**
* 根据用户编号获取授权角色
*/
@PreAuthorize("@ss.hasPermi('system:user:query')")
@GetMapping("/authRole/{userId}")
public AjaxResult authRole(@PathVariable("userId") Long userId)
{
AjaxResult ajax = AjaxResult.success();
SysUser user = userService.selectUserById(userId);
List<SysRole> roles = roleService.selectRolesByUserId(userId);
ajax.put("user", user);
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
return ajax;
}
/**
* 用户授权角色
*/
@PreAuthorize("@ss.hasPermi('system:user:edit')")
@Log(title = "用户管理", businessType = BusinessType.GRANT)
@PutMapping("/authRole")
public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
{
userService.checkUserDataScope(userId);
roleService.checkRoleDataScope(roleIds);
userService.insertUserAuth(userId, roleIds);
return success();
}
/**
* 获取部门树列表
*/
@PreAuthorize("@ss.hasPermi('system:user:list')")
@GetMapping("/deptTree")
public AjaxResult deptTree(SysDept dept)
{
return success(deptService.selectDeptTreeList(dept));
}
}

View File

@ -1,24 +0,0 @@
package com.ruoyi.web.controller.tool;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import com.ruoyi.common.core.controller.BaseController;
/**
* swagger 接口
*
* @author ruoyi
*/
@Controller
@RequestMapping("/tool/swagger")
public class SwaggerController extends BaseController
{
@PreAuthorize("@ss.hasPermi('tool:swagger:view')")
@GetMapping()
public String index()
{
return redirect("/swagger-ui.html");
}
}

View File

@ -9,13 +9,15 @@ 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.PutMapping;
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.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
@ -38,74 +40,80 @@ public class TestController extends BaseController
@ApiOperation("获取用户列表")
@GetMapping("/list")
public AjaxResult userList()
public R<List<UserEntity>> userList()
{
List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
return AjaxResult.success(userList);
return R.ok(userList);
}
@ApiOperation("获取用户详细")
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path")
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
@GetMapping("/{userId}")
public AjaxResult getUser(@PathVariable Integer userId)
public R<UserEntity> getUser(@PathVariable Integer userId)
{
if (!users.isEmpty() && users.containsKey(userId))
{
return AjaxResult.success(users.get(userId));
return R.ok(users.get(userId));
}
else
{
return AjaxResult.error("用户不存在");
return R.fail("用户不存在");
}
}
@ApiOperation("新增用户")
@ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "Integer", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "username", value = "用户名称", dataType = "String", dataTypeClass = String.class),
@ApiImplicitParam(name = "password", value = "用户密码", dataType = "String", dataTypeClass = String.class),
@ApiImplicitParam(name = "mobile", value = "用户手机", dataType = "String", dataTypeClass = String.class)
})
@PostMapping("/save")
public AjaxResult save(UserEntity user)
public R<String> save(UserEntity user)
{
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
{
return AjaxResult.error("用户ID不能为空");
return R.fail("用户ID不能为空");
}
return AjaxResult.success(users.put(user.getUserId(), user));
users.put(user.getUserId(), user);
return R.ok();
}
@ApiOperation("更新用户")
@ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity")
@PutMapping("/update")
public AjaxResult update(UserEntity user)
public R<String> update(@RequestBody UserEntity user)
{
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
{
return AjaxResult.error("用户ID不能为空");
return R.fail("用户ID不能为空");
}
if (users.isEmpty() || !users.containsKey(user.getUserId()))
{
return AjaxResult.error("用户不存在");
return R.fail("用户不存在");
}
users.remove(user.getUserId());
return AjaxResult.success(users.put(user.getUserId(), user));
users.put(user.getUserId(), user);
return R.ok();
}
@ApiOperation("删除用户信息")
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path")
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
@DeleteMapping("/{userId}")
public AjaxResult delete(@PathVariable Integer userId)
public R<String> delete(@PathVariable Integer userId)
{
if (!users.isEmpty() && users.containsKey(userId))
{
users.remove(userId);
return AjaxResult.success();
return R.ok();
}
else
{
return AjaxResult.error("用户不存在");
return R.fail("用户不存在");
}
}
}
@ApiModel("用户实体")
@ApiModel(value = "UserEntity", description = "用户实体")
class UserEntity
{
@ApiModelProperty("用户ID")

View File

@ -8,6 +8,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.ruoyi.common.config.RuoYiConfig;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
@ -16,10 +17,10 @@ import springfox.documentation.service.ApiKey;
import springfox.documentation.service.AuthorizationScope;
import springfox.documentation.service.Contact;
import springfox.documentation.service.SecurityReference;
import springfox.documentation.service.SecurityScheme;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.service.contexts.SecurityContext;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* Swagger2的接口配置
@ -27,7 +28,6 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
* @author ruoyi
*/
@Configuration
@EnableSwagger2
public class SwaggerConfig
{
/** 系统基础配置 */
@ -48,7 +48,7 @@ public class SwaggerConfig
@Bean
public Docket createRestApi()
{
return new Docket(DocumentationType.SWAGGER_2)
return new Docket(DocumentationType.OAS_30)
// 是否启用Swagger
.enable(enabled)
// 用来创建该API的基本信息展示在文档的页面中自定义展示的信息
@ -71,10 +71,10 @@ public class SwaggerConfig
/**
* 安全模式这里指定token通过Authorization头请求头传递
*/
private List<ApiKey> securitySchemes()
private List<SecurityScheme> securitySchemes()
{
List<ApiKey> apiKeyList = new ArrayList<ApiKey>();
apiKeyList.add(new ApiKey("Authorization", "Authorization", "header"));
List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>();
apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue()));
return apiKeyList;
}
@ -87,7 +87,7 @@ public class SwaggerConfig
securityContexts.add(
SecurityContext.builder()
.securityReferences(defaultAuth())
.forPaths(PathSelectors.regex("^(?!auth).*$"))
.operationSelector(o -> o.requestMappingPattern().matches("/.*"))
.build());
return securityContexts;
}

View File

@ -1 +1 @@
restart.include.json=/com.alibaba.fastjson.*.jar
restart.include.json=/com.alibaba.fastjson2.*.jar

View File

@ -24,6 +24,10 @@ spring:
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置连接超时时间
connectTimeout: 30000
# 配置网络超时时间
socketTimeout: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
@ -43,8 +47,8 @@ spring:
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username:
login-password:
login-username: ruoyi
login-password: 123456
filter:
stat:
enabled: true

View File

@ -3,16 +3,14 @@ ruoyi:
# 名称
name: RuoYi
# 版本
version: 3.2.0
version: 3.9.0
# 版权年份
copyrightYear: 2020
# 实例演示开关
demoEnabled: true
copyrightYear: 2025
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
profile: D:/ruoyi/uploadPath
# 获取ip地址开关
addressEnabled: false
# 验证码类型 math 数计算 char 字符验证
# 验证码类型 math 数计算 char 字符验证
captchaType: math
# 开发环境配置
@ -25,10 +23,13 @@ server:
tomcat:
# tomcat的URI编码
uri-encoding: UTF-8
# tomcat最大线程数,默认为200
max-threads: 800
# Tomcat启动初始化的线程数默认值25
min-spare-threads: 30
# 连接数满后的排队数,默认为100
accept-count: 1000
threads:
# tomcat最大线程数默认为200
max: 800
# Tomcat启动初始化的线程数默认值10
min-spare: 100
# 日志配置
logging:
@ -36,21 +37,29 @@ logging:
com.ruoyi: debug
org.springframework: warn
# 用户配置
user:
password:
# 密码最大错误次数
maxRetryCount: 5
# 密码锁定时间默认10分钟
lockTime: 10
# Spring配置
spring:
# 资源信息
messages:
# 国际化资源文件路径
basename: i18n/messages
profiles:
profiles:
active: druid
# 文件上传
servlet:
multipart:
# 单个文件大小
max-file-size: 10MB
# 设置总上传的文件大小
max-request-size: 20MB
multipart:
# 单个文件大小
max-file-size: 10MB
# 设置总上传的文件大小
max-request-size: 20MB
# 服务模块
devtools:
restart:
@ -62,8 +71,10 @@ spring:
host: localhost
# 端口默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
password:
password:
# 连接超时时间
timeout: 10s
lettuce:
@ -79,28 +90,27 @@ spring:
# token配置
token:
# 令牌自定义标识
header: Authorization
# 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期默认30分钟
expireTime: 30
# 令牌自定义标识
header: Authorization
# 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期默认30分钟
expireTime: 30
# MyBatis配置
mybatis:
# 搜索指定包别名
typeAliasesPackage: com.ruoyi.**.domain
# 配置mapper的扫描找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml
# 搜索指定包别名
typeAliasesPackage: com.ruoyi.**.domain
# 配置mapper的扫描找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml
# PageHelper分页插件
pagehelper:
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
params: count=countSql
# Swagger配置
swagger:
@ -109,11 +119,18 @@ swagger:
# 请求前缀
pathMapping: /dev-api
# 防盗链配置
referer:
# 防盗链开关
enabled: false
# 允许的域名列表
allowed-domains: localhost,127.0.0.1,ruoyi.vip,www.ruoyi.vip
# 防止XSS攻击
xss:
xss:
# 过滤开关
enabled: true
# 排除链接(多个用逗号分隔)
excludes: /system/notice/*
excludes: /system/notice
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*

View File

@ -5,10 +5,11 @@ user.jcaptcha.expire=验证码已失效
user.not.exists=用户不存在/密码错误
user.password.not.match=用户不存在/密码错误
user.password.retry.limit.count=密码输入错误{0}次
user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定10分钟
user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟
user.password.delete=对不起,您的账号已被删除
user.blocked=用户已封禁,请联系管理员
role.blocked=角色已封禁,请联系管理员
login.blocked=很遗憾访问IP已被列入系统黑名单
user.logout.success=退出成功
length.not.valid=长度必须在{min}到{max}个字符之间
@ -19,6 +20,7 @@ user.password.not.valid=* 5-50个字符
user.email.not.valid=邮箱格式错误
user.mobile.phone.number.not.valid=手机号格式错误
user.login.success=登录成功
user.register.success=注册成功
user.notfound=请重新登录
user.forcelogout=管理员强制退出,请重新登录
user.unknown.error=未知错误,请重新登录

View File

@ -3,13 +3,18 @@
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<settings>
<setting name="cacheEnabled" value="true" /> <!-- 全局映射器启用缓存 -->
<setting name="useGeneratedKeys" value="true" /> <!-- 允许 JDBC 支持自动生成主键 -->
<setting name="defaultExecutorType" value="REUSE" /> <!-- 配置默认的执行器 -->
<setting name="logImpl" value="SLF4J" /> <!-- 指定 MyBatis 所用日志的具体实现 -->
<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> 驼峰式命名 -->
<!-- 全局参数 -->
<settings>
<!-- 使全局映射器启用或禁用缓存 -->
<setting name="cacheEnabled" value="true" />
<!-- 允许JDBC 支持自动生成主键 -->
<setting name="useGeneratedKeys" value="true" />
<!-- 配置默认的执行器.SIMPLE就是普通执行器;REUSE执行器会重用预处理语句(prepared statements);BATCH执行器将重用语句并执行批量更新 -->
<setting name="defaultExecutorType" value="SIMPLE" />
<!-- 指定 MyBatis 所用日志的具体实现 -->
<setting name="logImpl" value="SLF4J" />
<!-- 使用驼峰命名法转换字段 -->
<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> -->
</settings>
</configuration>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.2.0</version>
<version>3.9.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -43,8 +43,8 @@
<!-- 自定义验证注解 -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<!--常用工具类 -->
@ -58,11 +58,11 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<!-- 阿里JSON解析器 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
</dependency>
<!-- io常用工具类 -->
@ -71,12 +71,6 @@
<artifactId>commons-io</artifactId>
</dependency>
<!-- 文件上传工具类 -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
</dependency>
<!-- excel工具 -->
<dependency>
<groupId>org.apache.poi</groupId>
@ -89,12 +83,18 @@
<artifactId>snakeyaml</artifactId>
</dependency>
<!--Token生成与解析-->
<!-- Token生成与解析-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
</dependency>
<!-- Jaxb -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<!-- redis 缓存操作 -->
<dependency>
<groupId>org.springframework.boot</groupId>

View File

@ -0,0 +1,19 @@
package com.ruoyi.common.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 匿名访问不鉴权注解
*
* @author ruoyi
*/
@Target({ ElementType.METHOD, ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Anonymous
{
}

View File

@ -25,4 +25,9 @@ public @interface DataScope
* 用户表的别名
*/
public String userAlias() default "";
/**
* 权限字符(用于多个角色匹配符合要求的权限)默认根据权限注解@ss获取多个权限用逗号分隔开来
*/
public String permission() default "";
}

View File

@ -5,6 +5,9 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.math.BigDecimal;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.IndexedColors;
import com.ruoyi.common.utils.poi.ExcelHandlerAdapter;
/**
* 自定义导出Excel数据注解
@ -56,17 +59,12 @@ public @interface Excel
public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
/**
* 导出类型0数字 1字符串
*/
public ColumnType cellType() default ColumnType.STRING;
/**
* 导出时在excel中每个列的高度 单位为字符
* 导出时在excel中每个列的高度
*/
public double height() default 14;
/**
* 导出时在excel中每个列的宽 单位为字符
* 导出时在excel中每个列的宽
*/
public double width() default 16;
@ -85,11 +83,26 @@ public @interface Excel
*/
public String prompt() default "";
/**
* 是否允许内容换行
*/
public boolean wrapText() default false;
/**
* 设置只能选择不能输入的列内容.
*/
public String[] combo() default {};
/**
* 是否从字典读数据到combo,默认不读取,如读取需要设置dictType注解.
*/
public boolean comboReadDict() default false;
/**
* 是否需要纵向合并单元格,应对需求:含有list集合单元格)
*/
public boolean needMerge() default false;
/**
* 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
*/
@ -105,6 +118,46 @@ public @interface Excel
*/
public boolean isStatistics() default false;
/**
* 导出类型0数字 1字符串 2图片
*/
public ColumnType cellType() default ColumnType.STRING;
/**
* 导出列头背景颜色
*/
public IndexedColors headerBackgroundColor() default IndexedColors.GREY_50_PERCENT;
/**
* 导出列头字体颜色
*/
public IndexedColors headerColor() default IndexedColors.WHITE;
/**
* 导出单元格背景颜色
*/
public IndexedColors backgroundColor() default IndexedColors.WHITE;
/**
* 导出单元格字体颜色
*/
public IndexedColors color() default IndexedColors.BLACK;
/**
* 导出字段对齐方式
*/
public HorizontalAlignment align() default HorizontalAlignment.CENTER;
/**
* 自定义数据处理器
*/
public Class<?> handler() default ExcelHandlerAdapter.class;
/**
* 自定义数据处理器参数
*/
public String[] args() default {};
/**
* 字段类型0导出导入1仅导出2仅导入
*/
@ -128,7 +181,7 @@ public @interface Excel
public enum ColumnType
{
NUMERIC(0), STRING(1);
NUMERIC(0), STRING(1), IMAGE(2), TEXT(3);
private final int value;
ColumnType(int value)

View File

@ -14,5 +14,5 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
public @interface Excels
{
Excel[] value();
public Excel[] value();
}

View File

@ -20,7 +20,7 @@ import com.ruoyi.common.enums.OperatorType;
public @interface Log
{
/**
* 模块
* 模块
*/
public String title() default "";
@ -38,4 +38,14 @@ public @interface Log
* 是否保存请求的参数
*/
public boolean isSaveRequestData() default true;
/**
* 是否保存响应的参数
*/
public boolean isSaveResponseData() default true;
/**
* 排除指定的请求参数
*/
public String[] excludeParamNames() default {};
}

View File

@ -0,0 +1,40 @@
package com.ruoyi.common.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.enums.LimitType;
/**
* 限流注解
*
* @author ruoyi
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RateLimiter
{
/**
* 限流key
*/
public String key() default CacheConstants.RATE_LIMIT_KEY;
/**
* 限流时间,单位秒
*/
public int time() default 60;
/**
* 限流次数
*/
public int count() default 100;
/**
* 限流类型
*/
public LimitType limitType() default LimitType.DEFAULT;
}

View File

@ -19,5 +19,13 @@ import java.lang.annotation.Target;
@Documented
public @interface RepeatSubmit
{
/**
* 间隔时间(ms),小于此时间视为重复提交
*/
public int interval() default 5000;
/**
* 提示消息
*/
public String message() default "不允许重复提交,请稍候再试";
}

View File

@ -0,0 +1,24 @@
package com.ruoyi.common.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ruoyi.common.config.serializer.SensitiveJsonSerializer;
import com.ruoyi.common.enums.DesensitizedType;
/**
* 数据脱敏注解
*
* @author ruoyi
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@JacksonAnnotationsInside
@JsonSerialize(using = SensitiveJsonSerializer.class)
public @interface Sensitive
{
DesensitizedType desensitizedType();
}

View File

@ -21,15 +21,15 @@ public class RuoYiConfig
/** 版权年份 */
private String copyrightYear;
/** 实例演示开关 */
private boolean demoEnabled;
/** 上传路径 */
private static String profile;
/** 获取地址开关 */
private static boolean addressEnabled;
/** 验证码类型 */
private static String captchaType;
public String getName()
{
return name;
@ -60,16 +60,6 @@ public class RuoYiConfig
this.copyrightYear = copyrightYear;
}
public boolean isDemoEnabled()
{
return demoEnabled;
}
public void setDemoEnabled(boolean demoEnabled)
{
this.demoEnabled = demoEnabled;
}
public static String getProfile()
{
return profile;
@ -90,6 +80,22 @@ public class RuoYiConfig
RuoYiConfig.addressEnabled = addressEnabled;
}
public static String getCaptchaType() {
return captchaType;
}
public void setCaptchaType(String captchaType) {
RuoYiConfig.captchaType = captchaType;
}
/**
* 获取导入上传路径
*/
public static String getImportPath()
{
return getProfile() + "/import";
}
/**
* 获取头像上传路径
*/

View File

@ -0,0 +1,67 @@
package com.ruoyi.common.config.serializer;
import java.io.IOException;
import java.util.Objects;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.BeanProperty;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.ContextualSerializer;
import com.ruoyi.common.annotation.Sensitive;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.enums.DesensitizedType;
import com.ruoyi.common.utils.SecurityUtils;
/**
* 数据脱敏序列化过滤
*
* @author ruoyi
*/
public class SensitiveJsonSerializer extends JsonSerializer<String> implements ContextualSerializer
{
private DesensitizedType desensitizedType;
@Override
public void serialize(String value, JsonGenerator gen, SerializerProvider serializers) throws IOException
{
if (desensitization())
{
gen.writeString(desensitizedType.desensitizer().apply(value));
}
else
{
gen.writeString(value);
}
}
@Override
public JsonSerializer<?> createContextual(SerializerProvider prov, BeanProperty property)
throws JsonMappingException
{
Sensitive annotation = property.getAnnotation(Sensitive.class);
if (Objects.nonNull(annotation) && Objects.equals(String.class, property.getType().getRawClass()))
{
this.desensitizedType = annotation.desensitizedType();
return this;
}
return prov.findValueSerializer(property.getType(), property);
}
/**
* 是否需要脱敏处理
*/
private boolean desensitization()
{
try
{
LoginUser securityUser = SecurityUtils.getLoginUser();
// 管理员不脱敏
return !securityUser.getUser().isAdmin();
}
catch (Exception e)
{
return true;
}
}
}

View File

@ -0,0 +1,44 @@
package com.ruoyi.common.constant;
/**
* 缓存的key 常量
*
* @author ruoyi
*/
public class CacheConstants
{
/**
* 登录用户 redis key
*/
public static final String LOGIN_TOKEN_KEY = "login_tokens:";
/**
* 验证码 redis key
*/
public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
/**
* 参数管理 cache key
*/
public static final String SYS_CONFIG_KEY = "sys_config:";
/**
* 字典管理 cache key
*/
public static final String SYS_DICT_KEY = "sys_dict:";
/**
* 防重提交 redis key
*/
public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";
/**
* 限流 redis key
*/
public static final String RATE_LIMIT_KEY = "rate_limit:";
/**
* 登录账户密码错误次数 redis key
*/
public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
}

View File

@ -1,5 +1,8 @@
package com.ruoyi.common.constant;
import java.util.Locale;
import io.jsonwebtoken.Claims;
/**
* 通用常量信息
*
@ -17,6 +20,16 @@ public class Constants
*/
public static final String GBK = "GBK";
/**
* 系统语言
*/
public static final Locale DEFAULT_LOCALE = Locale.SIMPLIFIED_CHINESE;
/**
* www主域
*/
public static final String WWW = "www.";
/**
* http请求
*/
@ -47,25 +60,35 @@ public class Constants
*/
public static final String LOGOUT = "Logout";
/**
* 注册
*/
public static final String REGISTER = "Register";
/**
* 登录失败
*/
public static final String LOGIN_FAIL = "Error";
/**
* 验证码 redis key
* 所有权限标识
*/
public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
public static final String ALL_PERMISSION = "*:*:*";
/**
* 登录用户 redis key
* 管理员角色权限标识
*/
public static final String LOGIN_TOKEN_KEY = "login_tokens:";
public static final String SUPER_ADMIN = "admin";
/**
* 防重提交 redis key
* 角色权限分隔符
*/
public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";
public static final String ROLE_DELIMITER = ",";
/**
* 权限标识分隔符
*/
public static final String PERMISSION_DELIMITER = ",";
/**
* 验证码有效期(分钟)
@ -95,7 +118,7 @@ public class Constants
/**
* 用户名称
*/
public static final String JWT_USERNAME = "sub";
public static final String JWT_USERNAME = Claims.SUBJECT;
/**
* 用户头像
@ -112,18 +135,39 @@ public class Constants
*/
public static final String JWT_AUTHORITIES = "authorities";
/**
* 参数管理 cache key
*/
public static final String SYS_CONFIG_KEY = "sys_config:";
/**
* 字典管理 cache key
*/
public static final String SYS_DICT_KEY = "sys_dict:";
/**
* 资源映射路径 前缀
*/
public static final String RESOURCE_PREFIX = "/profile";
/**
* RMI 远程方法调用
*/
public static final String LOOKUP_RMI = "rmi:";
/**
* LDAP 远程方法调用
*/
public static final String LOOKUP_LDAP = "ldap:";
/**
* LDAPS 远程方法调用
*/
public static final String LOOKUP_LDAPS = "ldaps:";
/**
* 自动识别json对象白名单配置仅允许解析的包名范围越小越安全
*/
public static final String[] JSON_WHITELIST_STR = { "com.ruoyi" };
/**
* 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
*/
public static final String[] JOB_WHITELIST_STR = { "com.ruoyi.quartz.task" };
/**
* 定时任务违规的字符
*/
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
"org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config", "com.ruoyi.generator" };
}

View File

@ -13,6 +13,9 @@ public class GenConstants
/** 树表(增删改查) */
public static final String TPL_TREE = "tree";
/** 主子表(增删改查) */
public static final String TPL_SUB = "sub";
/** 树编码字段 */
public static final String TREE_CODE = "treeCode";
@ -29,15 +32,17 @@ public class GenConstants
public static final String PARENT_MENU_NAME = "parentMenuName";
/** 数据库字符串类型 */
public static final String[] COLUMNTYPE_STR = { "char", "varchar", "nvarchar", "varchar2", "tinytext", "text",
"mediumtext", "longtext" };
public static final String[] COLUMNTYPE_STR = { "char", "varchar", "nvarchar", "varchar2" };
/** 数据库文本类型 */
public static final String[] COLUMNTYPE_TEXT = { "tinytext", "text", "mediumtext", "longtext" };
/** 数据库时间类型 */
public static final String[] COLUMNTYPE_TIME = { "datetime", "time", "date", "timestamp" };
/** 数据库数字类型 */
public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer",
"bigint", "float", "float", "double", "decimal" };
"bit", "bigint", "float", "double", "decimal" };
/** 页面不需要编辑字段 */
public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" };
@ -74,6 +79,12 @@ public class GenConstants
/** 日期控件 */
public static final String HTML_DATETIME = "datetime";
/** 图片上传控件 */
public static final String HTML_IMAGE_UPLOAD = "imageUpload";
/** 文件上传控件 */
public static final String HTML_FILE_UPLOAD = "fileUpload";
/** 富文本控件 */
public static final String HTML_EDITOR = "editor";
@ -98,6 +109,9 @@ public class GenConstants
/** 模糊查询 */
public static final String QUERY_LIKE = "LIKE";
/** 相等查询 */
public static final String QUERY_EQ = "EQ";
/** 需要 */
public static final String REQUIRE = "1";
}

View File

@ -86,4 +86,9 @@ public class HttpStatus
* 接口未实现
*/
public static final int NOT_IMPLEMENTED = 501;
/**
* 系统警告消息
*/
public static final int WARN = 601;
}

View File

@ -21,6 +21,9 @@ public class UserConstants
/** 用户封禁状态 */
public static final String USER_DISABLE = "1";
/** 角色正常状态 */
public static final String ROLE_NORMAL = "0";
/** 角色封禁状态 */
public static final String ROLE_DISABLE = "1";
@ -53,8 +56,26 @@ public class UserConstants
/** Layout组件标识 */
public final static String LAYOUT = "Layout";
/** ParentView组件标识 */
public final static String PARENT_VIEW = "ParentView";
/** 校验返回结果码 */
public final static String UNIQUE = "0";
public final static String NOT_UNIQUE = "1";
/** InnerLink组件标识 */
public final static String INNER_LINK = "InnerLink";
/** 校验是否唯一的返回标识 */
public final static boolean UNIQUE = true;
public final static boolean NOT_UNIQUE = false;
/**
* 用户名长度限制
*/
public static final int USERNAME_MIN_LENGTH = 2;
public static final int USERNAME_MAX_LENGTH = 20;
/**
* 密码长度限制
*/
public static final int PASSWORD_MIN_LENGTH = 5;
public static final int PASSWORD_MAX_LENGTH = 20;
}

View File

@ -11,10 +11,13 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.LoginUser;
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;
@ -25,7 +28,7 @@ import com.ruoyi.common.utils.sql.SqlUtil;
*/
public class BaseController
{
protected final Logger logger = LoggerFactory.getLogger(BaseController.class);
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
/**
* 将前台传递过来的日期格式的字符串自动转化为Date类型
@ -48,17 +51,31 @@ public class BaseController
* 设置请求分页数据
*/
protected void startPage()
{
PageUtils.startPage();
}
/**
* 设置请求排序数据
*/
protected void startOrderBy()
{
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
if (StringUtils.isNotEmpty(pageDomain.getOrderBy()))
{
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
PageHelper.startPage(pageNum, pageSize, orderBy);
PageHelper.orderBy(orderBy);
}
}
/**
* 清理分页的线程变量
*/
protected void clearPage()
{
PageUtils.clearPage();
}
/**
* 响应请求分页数据
*/
@ -73,6 +90,54 @@ public class BaseController
return rspData;
}
/**
* 返回成功
*/
public AjaxResult success()
{
return AjaxResult.success();
}
/**
* 返回失败消息
*/
public AjaxResult error()
{
return AjaxResult.error();
}
/**
* 返回成功消息
*/
public AjaxResult success(String message)
{
return AjaxResult.success(message);
}
/**
* 返回成功消息
*/
public AjaxResult success(Object data)
{
return AjaxResult.success(data);
}
/**
* 返回失败消息
*/
public AjaxResult error(String message)
{
return AjaxResult.error(message);
}
/**
* 返回警告消息
*/
public AjaxResult warn(String message)
{
return AjaxResult.warn(message);
}
/**
* 响应返回结果
*
@ -84,6 +149,17 @@ public class BaseController
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
}
/**
* 响应返回结果
*
* @param result 结果
* @return 操作结果
*/
protected AjaxResult toAjax(boolean result)
{
return result ? success() : error();
}
/**
* 页面跳转
*/
@ -91,4 +167,36 @@ public class BaseController
{
return StringUtils.format("redirect:{}", url);
}
/**
* 获取用户缓存信息
*/
public LoginUser getLoginUser()
{
return SecurityUtils.getLoginUser();
}
/**
* 获取登录用户id
*/
public Long getUserId()
{
return getLoginUser().getUserId();
}
/**
* 获取登录部门id
*/
public Long getDeptId()
{
return getLoginUser().getDeptId();
}
/**
* 获取登录用户名
*/
public String getUsername()
{
return getLoginUser().getUsername();
}
}

View File

@ -1,6 +1,7 @@
package com.ruoyi.common.core.domain;
import java.util.HashMap;
import java.util.Objects;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.utils.StringUtils;
@ -101,10 +102,33 @@ public class AjaxResult extends HashMap<String, Object>
return new AjaxResult(HttpStatus.SUCCESS, msg, data);
}
/**
* 返回警告消息
*
* @param msg 返回内容
* @return 警告消息
*/
public static AjaxResult warn(String msg)
{
return AjaxResult.warn(msg, null);
}
/**
* 返回警告消息
*
* @param msg 返回内容
* @param data 数据对象
* @return 警告消息
*/
public static AjaxResult warn(String msg, Object data)
{
return new AjaxResult(HttpStatus.WARN, msg, data);
}
/**
* 返回错误消息
*
* @return
* @return 错误消息
*/
public static AjaxResult error()
{
@ -115,7 +139,7 @@ public class AjaxResult extends HashMap<String, Object>
* 返回错误消息
*
* @param msg 返回内容
* @return 警告消息
* @return 错误消息
*/
public static AjaxResult error(String msg)
{
@ -127,7 +151,7 @@ public class AjaxResult extends HashMap<String, Object>
*
* @param msg 返回内容
* @param data 数据对象
* @return 警告消息
* @return 错误消息
*/
public static AjaxResult error(String msg, Object data)
{
@ -139,10 +163,54 @@ public class AjaxResult extends HashMap<String, Object>
*
* @param code 状态码
* @param msg 返回内容
* @return 警告消息
* @return 错误消息
*/
public static AjaxResult error(int code, String msg)
{
return new AjaxResult(code, msg, null);
}
/**
* 是否为成功消息
*
* @return 结果
*/
public boolean isSuccess()
{
return Objects.equals(HttpStatus.SUCCESS, this.get(CODE_TAG));
}
/**
* 是否为警告消息
*
* @return 结果
*/
public boolean isWarn()
{
return Objects.equals(HttpStatus.WARN, this.get(CODE_TAG));
}
/**
* 是否为错误消息
*
* @return 结果
*/
public boolean isError()
{
return Objects.equals(HttpStatus.ERROR, this.get(CODE_TAG));
}
/**
* 方便链式调用
*
* @param key 键
* @param value 值
* @return 数据对象
*/
@Override
public AjaxResult put(String key, Object value)
{
super.put(key, value);
return this;
}
}

View File

@ -6,6 +6,7 @@ import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
/**
* Entity基类
@ -17,6 +18,7 @@ public class BaseEntity implements Serializable
private static final long serialVersionUID = 1L;
/** 搜索值 */
@JsonIgnore
private String searchValue;
/** 创建者 */
@ -36,15 +38,8 @@ public class BaseEntity implements Serializable
/** 备注 */
private String remark;
/** 开始时间 */
@JsonIgnore
private String beginTime;
/** 结束时间 */
@JsonIgnore
private String endTime;
/** 请求参数 */
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private Map<String, Object> params;
public String getSearchValue()
@ -107,26 +102,6 @@ public class BaseEntity implements Serializable
this.remark = remark;
}
public String getBeginTime()
{
return beginTime;
}
public void setBeginTime(String beginTime)
{
this.beginTime = beginTime;
}
public String getEndTime()
{
return endTime;
}
public void setEndTime(String endTime)
{
this.endTime = endTime;
}
public Map<String, Object> getParams()
{
if (params == null)

View File

@ -0,0 +1,115 @@
package com.ruoyi.common.core.domain;
import java.io.Serializable;
import com.ruoyi.common.constant.HttpStatus;
/**
* 响应信息主体
*
* @author ruoyi
*/
public class R<T> implements Serializable
{
private static final long serialVersionUID = 1L;
/** 成功 */
public static final int SUCCESS = HttpStatus.SUCCESS;
/** 失败 */
public static final int FAIL = HttpStatus.ERROR;
private int code;
private String msg;
private T data;
public static <T> R<T> ok()
{
return restResult(null, SUCCESS, "操作成功");
}
public static <T> R<T> ok(T data)
{
return restResult(data, SUCCESS, "操作成功");
}
public static <T> R<T> ok(T data, String msg)
{
return restResult(data, SUCCESS, msg);
}
public static <T> R<T> fail()
{
return restResult(null, FAIL, "操作失败");
}
public static <T> R<T> fail(String msg)
{
return restResult(null, FAIL, msg);
}
public static <T> R<T> fail(T data)
{
return restResult(data, FAIL, "操作失败");
}
public static <T> R<T> fail(T data, String msg)
{
return restResult(data, FAIL, msg);
}
public static <T> R<T> fail(int code, String msg)
{
return restResult(null, code, msg);
}
private static <T> R<T> restResult(T data, int code, String msg)
{
R<T> apiResult = new R<>();
apiResult.setCode(code);
apiResult.setData(data);
apiResult.setMsg(msg);
return apiResult;
}
public int getCode()
{
return code;
}
public void setCode(int code)
{
this.code = code;
}
public String getMsg()
{
return msg;
}
public void setMsg(String msg)
{
this.msg = msg;
}
public T getData()
{
return data;
}
public void setData(T data)
{
this.data = data;
}
public static <T> Boolean isError(R<T> ret)
{
return !isSuccess(ret);
}
public static <T> Boolean isSuccess(R<T> ret)
{
return R.SUCCESS == ret.getCode();
}
}

View File

@ -4,8 +4,10 @@ import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysMenu;
import com.ruoyi.common.utils.StringUtils;
/**
* Treeselect树结构实体类
@ -22,6 +24,9 @@ public class TreeSelect implements Serializable
/** 节点名称 */
private String label;
/** 节点禁用 */
private boolean disabled = false;
/** 子节点 */
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<TreeSelect> children;
@ -35,6 +40,7 @@ public class TreeSelect implements Serializable
{
this.id = dept.getDeptId();
this.label = dept.getDeptName();
this.disabled = StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus());
this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
}
@ -65,6 +71,16 @@ public class TreeSelect implements Serializable
this.label = label;
}
public boolean isDisabled()
{
return disabled;
}
public void setDisabled(boolean disabled)
{
this.disabled = disabled;
}
public List<TreeSelect> getChildren()
{
return children;

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -31,7 +32,7 @@ public class SysDept extends BaseEntity
private String deptName;
/** 显示顺序 */
private String orderNum;
private Integer orderNum;
/** 负责人 */
private String leader;
@ -96,13 +97,13 @@ public class SysDept extends BaseEntity
this.deptName = deptName;
}
@NotBlank(message = "显示顺序不能为空")
public String getOrderNum()
@NotNull(message = "显示顺序不能为空")
public Integer getOrderNum()
{
return orderNum;
}
public void setOrderNum(String orderNum)
public void setOrderNum(Integer orderNum)
{
this.orderNum = orderNum;
}

View File

@ -131,7 +131,7 @@ public class SysDictData extends BaseEntity
public boolean getDefault()
{
return UserConstants.YES.equals(this.isDefault) ? true : false;
return UserConstants.YES.equals(this.isDefault);
}
public String getIsDefault()

View File

@ -1,6 +1,7 @@
package com.ruoyi.common.core.domain.entity;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -57,6 +58,7 @@ public class SysDictType extends BaseEntity
@NotBlank(message = "字典类型不能为空")
@Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符")
@Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)")
public String getDictType()
{
return dictType;

View File

@ -3,6 +3,7 @@ package com.ruoyi.common.core.domain.entity;
import java.util.ArrayList;
import java.util.List;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -30,7 +31,7 @@ public class SysMenu extends BaseEntity
private Long parentId;
/** 显示顺序 */
private String orderNum;
private Integer orderNum;
/** 路由地址 */
private String path;
@ -38,6 +39,12 @@ public class SysMenu extends BaseEntity
/** 组件路径 */
private String component;
/** 路由参数 */
private String query;
/** 路由名称默认和路由地址相同的驼峰格式注意因为vue3版本的router会删除名称相同路由为避免名字的冲突特殊情况可以自定义 */
private String routeName;
/** 是否为外链0是 1否 */
private String isFrame;
@ -49,8 +56,8 @@ public class SysMenu extends BaseEntity
/** 显示状态0显示 1隐藏 */
private String visible;
/** 菜单状态0显示 1隐藏 */
/** 菜单状态0正常 1停用 */
private String status;
/** 权限字符串 */
@ -104,13 +111,13 @@ public class SysMenu extends BaseEntity
this.parentId = parentId;
}
@NotBlank(message = "显示顺序不能为空")
public String getOrderNum()
@NotNull(message = "显示顺序不能为空")
public Integer getOrderNum()
{
return orderNum;
}
public void setOrderNum(String orderNum)
public void setOrderNum(Integer orderNum)
{
this.orderNum = orderNum;
}
@ -137,6 +144,26 @@ public class SysMenu extends BaseEntity
this.component = component;
}
public String getQuery()
{
return query;
}
public void setQuery(String query)
{
this.query = query;
}
public String getRouteName()
{
return routeName;
}
public void setRouteName(String routeName)
{
this.routeName = routeName;
}
public String getIsFrame()
{
return isFrame;
@ -218,7 +245,7 @@ public class SysMenu extends BaseEntity
{
this.children = children;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -228,6 +255,8 @@ public class SysMenu extends BaseEntity
.append("orderNum", getOrderNum())
.append("path", getPath())
.append("component", getComponent())
.append("query", getQuery())
.append("routeName", getRouteName())
.append("isFrame", getIsFrame())
.append("IsCache", getIsCache())
.append("menuType", getMenuType())

View File

@ -1,6 +1,8 @@
package com.ruoyi.common.core.domain.entity;
import java.util.Set;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -31,10 +33,10 @@ public class SysRole extends BaseEntity
/** 角色排序 */
@Excel(name = "角色排序")
private String roleSort;
private Integer roleSort;
/** 数据范围1所有数据权限2自定义数据权限3本部门数据权限4本部门及以下数据权限 */
@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限")
/** 数据范围1所有数据权限2自定义数据权限3本部门数据权限4本部门及以下数据权限5仅本人数据权限 */
@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限")
private String dataScope;
/** 菜单树选择项是否关联显示( 0父子不互相关联显示 1父子互相关联显示 */
@ -59,6 +61,9 @@ public class SysRole extends BaseEntity
/** 部门组(数据权限) */
private Long[] deptIds;
/** 角色菜单权限 */
private Set<String> permissions;
public SysRole()
{
@ -113,13 +118,13 @@ public class SysRole extends BaseEntity
this.roleKey = roleKey;
}
@NotBlank(message = "显示顺序不能为空")
public String getRoleSort()
@NotNull(message = "显示顺序不能为空")
public Integer getRoleSort()
{
return roleSort;
}
public void setRoleSort(String roleSort)
public void setRoleSort(Integer roleSort)
{
this.roleSort = roleSort;
}
@ -203,7 +208,17 @@ public class SysRole extends BaseEntity
{
this.deptIds = deptIds;
}
public Set<String> getPermissions()
{
return permissions;
}
public void setPermissions(Set<String> permissions)
{
this.permissions = permissions;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -2,18 +2,16 @@ package com.ruoyi.common.core.domain.entity;
import java.util.Date;
import java.util.List;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import javax.validation.constraints.*;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excel.ColumnType;
import com.ruoyi.common.annotation.Excel.Type;
import com.ruoyi.common.annotation.Excels;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.xss.Xss;
/**
* 用户对象 sys_user
@ -25,7 +23,7 @@ public class SysUser extends BaseEntity
private static final long serialVersionUID = 1L;
/** 用户ID */
@Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号")
@Excel(name = "用户序号", type = Type.EXPORT, cellType = ColumnType.NUMERIC, prompt = "用户编号")
private Long userId;
/** 部门ID */
@ -45,7 +43,7 @@ public class SysUser extends BaseEntity
private String email;
/** 手机号码 */
@Excel(name = "手机号码")
@Excel(name = "手机号码", cellType = ColumnType.TEXT)
private String phonenumber;
/** 用户性别 */
@ -58,11 +56,8 @@ public class SysUser extends BaseEntity
/** 密码 */
private String password;
/** 盐加密 */
private String salt;
/** 帐号状态0正常 1停用 */
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
/** 账号状态0正常 1停用 */
@Excel(name = "账号状态", readConverterExp = "0=正常,1=停用")
private String status;
/** 删除标志0代表存在 2代表删除 */
@ -76,6 +71,9 @@ public class SysUser extends BaseEntity
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
private Date loginDate;
/** 密码最后更新时间 */
private Date pwdUpdateDate;
/** 部门对象 */
@Excels({
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
@ -92,6 +90,9 @@ public class SysUser extends BaseEntity
/** 岗位组 */
private Long[] postIds;
/** 角色ID */
private Long roleId;
public SysUser()
{
@ -132,6 +133,7 @@ public class SysUser extends BaseEntity
this.deptId = deptId;
}
@Xss(message = "用户昵称不能包含脚本字符")
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
public String getNickName()
{
@ -143,6 +145,7 @@ public class SysUser extends BaseEntity
this.nickName = nickName;
}
@Xss(message = "用户账号不能包含脚本字符")
@NotBlank(message = "用户账号不能为空")
@Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
public String getUserName()
@ -198,8 +201,7 @@ public class SysUser extends BaseEntity
this.avatar = avatar;
}
@JsonIgnore
@JsonProperty
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
public String getPassword()
{
return password;
@ -210,16 +212,6 @@ public class SysUser extends BaseEntity
this.password = password;
}
public String getSalt()
{
return salt;
}
public void setSalt(String salt)
{
this.salt = salt;
}
public String getStatus()
{
return status;
@ -260,6 +252,16 @@ public class SysUser extends BaseEntity
this.loginDate = loginDate;
}
public Date getPwdUpdateDate()
{
return pwdUpdateDate;
}
public void setPwdUpdateDate(Date pwdUpdateDate)
{
this.pwdUpdateDate = pwdUpdateDate;
}
public SysDept getDept()
{
return dept;
@ -300,6 +302,16 @@ public class SysUser extends BaseEntity
this.postIds = postIds;
}
public Long getRoleId()
{
return roleId;
}
public void setRoleId(Long roleId)
{
this.roleId = roleId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -312,11 +324,11 @@ public class SysUser extends BaseEntity
.append("sex", getSex())
.append("avatar", getAvatar())
.append("password", getPassword())
.append("salt", getSalt())
.append("status", getStatus())
.append("delFlag", getDelFlag())
.append("loginIp", getLoginIp())
.append("loginDate", getLoginDate())
.append("pwdUpdateDate", getPwdUpdateDate())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())

View File

@ -25,7 +25,7 @@ public class LoginBody
/**
* 唯一标识
*/
private String uuid = "";
private String uuid;
public String getUsername()
{

View File

@ -1,11 +1,11 @@
package com.ruoyi.common.core.domain.model;
import java.util.Collection;
import java.util.Set;
import com.alibaba.fastjson2.annotation.JSONField;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ruoyi.common.core.domain.entity.SysUser;
import java.util.Collection;
import java.util.Set;
/**
* 登录用户身份权限
@ -16,6 +16,16 @@ public class LoginUser implements UserDetails
{
private static final long serialVersionUID = 1L;
/**
* 用户ID
*/
private Long userId;
/**
* 部门ID
*/
private Long deptId;
/**
* 用户唯一标识
*/
@ -61,16 +71,6 @@ public class LoginUser implements UserDetails
*/
private SysUser user;
public String getToken()
{
return token;
}
public void setToken(String token)
{
this.token = token;
}
public LoginUser()
{
}
@ -81,7 +81,45 @@ public class LoginUser implements UserDetails
this.permissions = permissions;
}
@JsonIgnore
public LoginUser(Long userId, Long deptId, SysUser user, Set<String> permissions)
{
this.userId = userId;
this.deptId = deptId;
this.user = user;
this.permissions = permissions;
}
public Long getUserId()
{
return userId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getDeptId()
{
return deptId;
}
public void setDeptId(Long deptId)
{
this.deptId = deptId;
}
public String getToken()
{
return token;
}
public void setToken(String token)
{
this.token = token;
}
@JSONField(serialize = false)
@Override
public String getPassword()
{
@ -97,7 +135,7 @@ public class LoginUser implements UserDetails
/**
* 账户是否未过期,过期无法验证
*/
@JsonIgnore
@JSONField(serialize = false)
@Override
public boolean isAccountNonExpired()
{
@ -109,7 +147,7 @@ public class LoginUser implements UserDetails
*
* @return
*/
@JsonIgnore
@JSONField(serialize = false)
@Override
public boolean isAccountNonLocked()
{
@ -121,7 +159,7 @@ public class LoginUser implements UserDetails
*
* @return
*/
@JsonIgnore
@JSONField(serialize = false)
@Override
public boolean isCredentialsNonExpired()
{
@ -133,7 +171,7 @@ public class LoginUser implements UserDetails
*
* @return
*/
@JsonIgnore
@JSONField(serialize = false)
@Override
public boolean isEnabled()
{

View File

@ -0,0 +1,11 @@
package com.ruoyi.common.core.domain.model;
/**
* 用户注册对象
*
* @author ruoyi
*/
public class RegisterBody extends LoginBody
{
}

View File

@ -1,72 +1,101 @@
package com.ruoyi.common.core.page;
import com.ruoyi.common.utils.StringUtils;
/**
* 分页数据
*
* @author ruoyi
*/
public class PageDomain
{
/** 当前记录起始索引 */
private Integer pageNum;
/** 每页显示记录数 */
private Integer pageSize;
/** 排序列 */
private String orderByColumn;
/** 排序的方向desc或者asc */
private String isAsc = "asc";
public String getOrderBy()
{
if (StringUtils.isEmpty(orderByColumn))
{
return "";
}
return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
}
public Integer getPageNum()
{
return pageNum;
}
public void setPageNum(Integer pageNum)
{
this.pageNum = pageNum;
}
public Integer getPageSize()
{
return pageSize;
}
public void setPageSize(Integer pageSize)
{
this.pageSize = pageSize;
}
public String getOrderByColumn()
{
return orderByColumn;
}
public void setOrderByColumn(String orderByColumn)
{
this.orderByColumn = orderByColumn;
}
public String getIsAsc()
{
return isAsc;
}
public void setIsAsc(String isAsc)
{
this.isAsc = isAsc;
}
}
package com.ruoyi.common.core.page;
import com.ruoyi.common.utils.StringUtils;
/**
* 分页数据
*
* @author ruoyi
*/
public class PageDomain
{
/** 当前记录起始索引 */
private Integer pageNum;
/** 每页显示记录数 */
private Integer pageSize;
/** 排序列 */
private String orderByColumn;
/** 排序的方向desc或者asc */
private String isAsc = "asc";
/** 分页参数合理化 */
private Boolean reasonable = true;
public String getOrderBy()
{
if (StringUtils.isEmpty(orderByColumn))
{
return "";
}
return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
}
public Integer getPageNum()
{
return pageNum;
}
public void setPageNum(Integer pageNum)
{
this.pageNum = pageNum;
}
public Integer getPageSize()
{
return pageSize;
}
public void setPageSize(Integer pageSize)
{
this.pageSize = pageSize;
}
public String getOrderByColumn()
{
return orderByColumn;
}
public void setOrderByColumn(String orderByColumn)
{
this.orderByColumn = orderByColumn;
}
public String getIsAsc()
{
return isAsc;
}
public void setIsAsc(String isAsc)
{
if (StringUtils.isNotEmpty(isAsc))
{
// 兼容前端排序类型
if ("ascending".equals(isAsc))
{
isAsc = "asc";
}
else if ("descending".equals(isAsc))
{
isAsc = "desc";
}
this.isAsc = isAsc;
}
}
public Boolean getReasonable()
{
if (StringUtils.isNull(reasonable))
{
return Boolean.TRUE;
}
return reasonable;
}
public void setReasonable(Boolean reasonable)
{
this.reasonable = reasonable;
}
}

View File

@ -37,7 +37,7 @@ public class TableDataInfo implements Serializable
* @param list 列表数据
* @param total 总记录数
*/
public TableDataInfo(List<?> list, int total)
public TableDataInfo(List<?> list, long total)
{
this.rows = list;
this.total = total;

View File

@ -1,5 +1,6 @@
package com.ruoyi.common.core.page;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.ServletUtils;
/**
@ -29,16 +30,22 @@ public class TableSupport
*/
public static final String IS_ASC = "isAsc";
/**
* 分页参数合理化
*/
public static final String REASONABLE = "reasonable";
/**
* 封装分页对象
*/
public static PageDomain getPageDomain()
{
PageDomain pageDomain = new PageDomain();
pageDomain.setPageNum(ServletUtils.getParameterToInt(PAGE_NUM));
pageDomain.setPageSize(ServletUtils.getParameterToInt(PAGE_SIZE));
pageDomain.setPageNum(Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1));
pageDomain.setPageSize(Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10));
pageDomain.setOrderByColumn(ServletUtils.getParameter(ORDER_BY_COLUMN));
pageDomain.setIsAsc(ServletUtils.getParameter(IS_ASC));
pageDomain.setReasonable(ServletUtils.getParameterToBool(REASONABLE));
return pageDomain;
}

View File

@ -1,11 +1,13 @@
package com.ruoyi.common.core.redis;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.BoundSetOperations;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
@ -72,6 +74,28 @@ public class RedisCache
return redisTemplate.expire(key, timeout, unit);
}
/**
* 获取有效时间
*
* @param key Redis键
* @return 有效时间
*/
public long getExpire(final String key)
{
return redisTemplate.getExpire(key);
}
/**
* 判断 key是否存在
*
* @param key 键
* @return true 存在 false不存在
*/
public Boolean hasKey(String key)
{
return redisTemplate.hasKey(key);
}
/**
* 获得缓存的基本对象。
*
@ -100,9 +124,9 @@ public class RedisCache
* @param collection 多个对象
* @return
*/
public long deleteObject(final Collection collection)
public boolean deleteObject(final Collection collection)
{
return redisTemplate.delete(collection);
return redisTemplate.delete(collection) > 0;
}
/**
@ -136,10 +160,15 @@ public class RedisCache
* @param dataSet 缓存的数据
* @return 缓存数据的对象
*/
public <T> long setCacheSet(final String key, final Set<T> dataSet)
public <T> BoundSetOperations<String, T> setCacheSet(final String key, final Set<T> dataSet)
{
Long count = redisTemplate.opsForSet().add(key, dataSet);
return count == null ? 0 : count;
BoundSetOperations<String, T> setOperation = redisTemplate.boundSetOps(key);
Iterator<T> it = dataSet.iterator();
while (it.hasNext())
{
setOperation.add(it.next());
}
return setOperation;
}
/**
@ -214,6 +243,18 @@ public class RedisCache
return redisTemplate.opsForHash().multiGet(key, hKeys);
}
/**
* 删除Hash中的某条数据
*
* @param key Redis键
* @param hKey Hash键
* @return 是否成功
*/
public boolean deleteCacheMapValue(final String key, final String hKey)
{
return redisTemplate.opsForHash().delete(key, hKey) > 0;
}
/**
* 获得缓存的基本对象列表
*

View File

@ -66,7 +66,7 @@ public class CharsetKit
if (null == destCharset)
{
srcCharset = StandardCharsets.UTF_8;
destCharset = StandardCharsets.UTF_8;
}
if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset))

View File

@ -2,6 +2,7 @@ package com.ruoyi.common.core.text;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.text.NumberFormat;
@ -10,7 +11,7 @@ import com.ruoyi.common.utils.StringUtils;
/**
* 类型转换器
*
*
* @author ruoyi
*/
public class Convert
@ -19,7 +20,7 @@ public class Convert
* 转换为字符串<br>
* 如果给定的值为null或者转换失败返回默认值<br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
@ -41,7 +42,7 @@ public class Convert
* 转换为字符串<br>
* 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @return 结果
*/
@ -54,7 +55,7 @@ public class Convert
* 转换为字符<br>
* 如果给定的值为null或者转换失败返回默认值<br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
@ -78,7 +79,7 @@ public class Convert
* 转换为字符<br>
* 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @return 结果
*/
@ -91,7 +92,7 @@ public class Convert
* 转换为byte<br>
* 如果给定的值为<code>null</code>,或者转换失败,返回默认值<br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
@ -129,7 +130,7 @@ public class Convert
* 转换为byte<br>
* 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @return 结果
*/
@ -142,7 +143,7 @@ public class Convert
* 转换为Short<br>
* 如果给定的值为<code>null</code>,或者转换失败,返回默认值<br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
@ -180,7 +181,7 @@ public class Convert
* 转换为Short<br>
* 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @return 结果
*/
@ -193,7 +194,7 @@ public class Convert
* 转换为Number<br>
* 如果给定的值为空,或者转换失败,返回默认值<br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
@ -227,7 +228,7 @@ public class Convert
* 转换为Number<br>
* 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @return 结果
*/
@ -240,7 +241,7 @@ public class Convert
* 转换为int<br>
* 如果给定的值为空,或者转换失败,返回默认值<br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
@ -278,7 +279,7 @@ public class Convert
* 转换为int<br>
* 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @return 结果
*/
@ -289,7 +290,7 @@ public class Convert
/**
* 转换为Integer数组<br>
*
*
* @param str 被转换的值
* @return 结果
*/
@ -300,7 +301,7 @@ public class Convert
/**
* 转换为Long数组<br>
*
*
* @param str 被转换的值
* @return 结果
*/
@ -311,7 +312,7 @@ public class Convert
/**
* 转换为Integer数组<br>
*
*
* @param split 分隔符
* @param split 被转换的值
* @return 结果
@ -334,7 +335,7 @@ public class Convert
/**
* 转换为Long数组<br>
*
*
* @param split 分隔符
* @param str 被转换的值
* @return 结果
@ -357,18 +358,22 @@ public class Convert
/**
* 转换为String数组<br>
*
*
* @param str 被转换的值
* @return 结果
*/
public static String[] toStrArray(String str)
{
if (StringUtils.isEmpty(str))
{
return new String[] {};
}
return toStrArray(",", str);
}
/**
* 转换为String数组<br>
*
*
* @param split 分隔符
* @param split 被转换的值
* @return 结果
@ -382,7 +387,7 @@ public class Convert
* 转换为long<br>
* 如果给定的值为空,或者转换失败,返回默认值<br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
@ -421,7 +426,7 @@ public class Convert
* 转换为long<br>
* 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @return 结果
*/
@ -434,7 +439,7 @@ public class Convert
* 转换为double<br>
* 如果给定的值为空,或者转换失败,返回默认值<br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
@ -473,7 +478,7 @@ public class Convert
* 转换为double<br>
* 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @return 结果
*/
@ -486,7 +491,7 @@ public class Convert
* 转换为Float<br>
* 如果给定的值为空,或者转换失败,返回默认值<br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
@ -524,7 +529,7 @@ public class Convert
* 转换为Float<br>
* 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @return 结果
*/
@ -535,9 +540,9 @@ public class Convert
/**
* 转换为boolean<br>
* String支持的值为true、false、yes、ok、no1,0 如果给定的值为空,或者转换失败,返回默认值<br>
* String支持的值为true、false、yes、ok、no、1、0、是、否, 如果给定的值为空,或者转换失败,返回默认值<br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
@ -561,18 +566,15 @@ public class Convert
switch (valueStr)
{
case "true":
case "yes":
case "ok":
case "1":
case "":
return true;
case "false":
return false;
case "yes":
return true;
case "ok":
return true;
case "no":
return false;
case "1":
return true;
case "0":
case "":
return false;
default:
return defaultValue;
@ -583,7 +585,7 @@ public class Convert
* 转换为boolean<br>
* 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @return 结果
*/
@ -595,7 +597,7 @@ public class Convert
/**
* 转换为Enum对象<br>
* 如果给定的值为空,或者转换失败,返回默认值<br>
*
*
* @param clazz Enum的Class
* @param value 值
* @param defaultValue 默认值
@ -631,7 +633,7 @@ public class Convert
/**
* 转换为Enum对象<br>
* 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br>
*
*
* @param clazz Enum的Class
* @param value 值
* @return Enum
@ -645,7 +647,7 @@ public class Convert
* 转换为BigInteger<br>
* 如果给定的值为空,或者转换失败,返回默认值<br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
@ -683,7 +685,7 @@ public class Convert
* 转换为BigInteger<br>
* 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @return 结果
*/
@ -696,7 +698,7 @@ public class Convert
* 转换为BigDecimal<br>
* 如果给定的值为空,或者转换失败,返回默认值<br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @param defaultValue 转换错误时的默认值
* @return 结果
@ -717,7 +719,7 @@ public class Convert
}
if (value instanceof Double)
{
return new BigDecimal((Double) value);
return BigDecimal.valueOf((Double) value);
}
if (value instanceof Integer)
{
@ -742,7 +744,7 @@ public class Convert
* 转换为BigDecimal<br>
* 如果给定的值为空,或者转换失败,返回默认值<br>
* 转换失败不会报错
*
*
* @param value 被转换的值
* @return 结果
*/
@ -754,7 +756,7 @@ public class Convert
/**
* 将对象转为字符串<br>
* 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法
*
*
* @param obj 对象
* @return 字符串
*/
@ -766,7 +768,7 @@ public class Convert
/**
* 将对象转为字符串<br>
* 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法
*
*
* @param obj 对象
* @param charsetName 字符集
* @return 字符串
@ -779,7 +781,7 @@ public class Convert
/**
* 将对象转为字符串<br>
* 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法
*
*
* @param obj 对象
* @param charset 字符集
* @return 字符串
@ -797,7 +799,21 @@ public class Convert
}
else if (obj instanceof byte[] || obj instanceof Byte[])
{
return str((Byte[]) obj, charset);
if (obj instanceof byte[])
{
return str((byte[]) obj, charset);
}
else
{
Byte[] bytes = (Byte[]) obj;
int length = bytes.length;
byte[] dest = new byte[length];
for (int i = 0; i < length; i++)
{
dest[i] = bytes[i];
}
return str(dest, charset);
}
}
else if (obj instanceof ByteBuffer)
{
@ -808,7 +824,7 @@ public class Convert
/**
* 将byte数组转为字符串
*
*
* @param bytes byte数组
* @param charset 字符集
* @return 字符串
@ -820,7 +836,7 @@ public class Convert
/**
* 解码字节码
*
*
* @param data 字符串
* @param charset 字符集,如果此字段为空,则解码的结果取决于平台
* @return 解码后的字符串
@ -841,7 +857,7 @@ public class Convert
/**
* 将编码的byteBuffer数据转换为字符串
*
*
* @param data 数据
* @param charset 字符集,如果为空使用当前系统字符集
* @return 字符串
@ -858,7 +874,7 @@ public class Convert
/**
* 将编码的byteBuffer数据转换为字符串
*
*
* @param data 数据
* @param charset 字符集,如果为空使用当前系统字符集
* @return 字符串
@ -875,7 +891,7 @@ public class Convert
// ----------------------------------------------------------------------- 全角半角转换
/**
* 半角转全角
*
*
* @param input String.
* @return 全角字符串.
*/
@ -886,14 +902,14 @@ public class Convert
/**
* 半角转全角
*
*
* @param input String
* @param notConvertSet 不替换的字符集合
* @return 全角字符串.
*/
public static String toSBC(String input, Set<Character> notConvertSet)
{
char c[] = input.toCharArray();
char[] c = input.toCharArray();
for (int i = 0; i < c.length; i++)
{
if (null != notConvertSet && notConvertSet.contains(c[i]))
@ -917,7 +933,7 @@ public class Convert
/**
* 全角转半角
*
*
* @param input String.
* @return 半角字符串
*/
@ -928,14 +944,14 @@ public class Convert
/**
* 替换全角为半角
*
*
* @param text 文本
* @param notConvertSet 不替换的字符集合
* @return 替换后的字符
*/
public static String toDBC(String text, Set<Character> notConvertSet)
{
char c[] = text.toCharArray();
char[] c = text.toCharArray();
for (int i = 0; i < c.length; i++)
{
if (null != notConvertSet && notConvertSet.contains(c[i]))
@ -953,14 +969,12 @@ public class Convert
c[i] = (char) (c[i] - 65248);
}
}
String returnString = new String(c);
return returnString;
return new String(c);
}
/**
* 数字金额大写转换 先写个完整的然后将如零拾替换成零
*
*
* @param n 数字
* @return 中文大写数字
*/
@ -976,7 +990,12 @@ public class Convert
String s = "";
for (int i = 0; i < fraction.length; i++)
{
s += (digit[(int) (Math.floor(n * 10 * Math.pow(10, i)) % 10)] + fraction[i]).replaceAll("(零.)+", "");
// 优化double计算精度丢失问题
BigDecimal nNum = new BigDecimal(n);
BigDecimal decimal = new BigDecimal(10);
BigDecimal scale = nNum.multiply(decimal).setScale(2, RoundingMode.HALF_EVEN);
double d = scale.doubleValue();
s += (digit[(int) (Math.floor(d * Math.pow(10, i)) % 10)] + fraction[i]).replaceAll("(零.)+", "");
}
if (s.length() < 1)
{

View File

@ -0,0 +1,59 @@
package com.ruoyi.common.enums;
import java.util.function.Function;
import com.ruoyi.common.utils.DesensitizedUtil;
/**
* 脱敏类型
*
* @author ruoyi
*/
public enum DesensitizedType
{
/**
* 姓名第2位星号替换
*/
USERNAME(s -> s.replaceAll("(\\S)\\S(\\S*)", "$1*$2")),
/**
* 密码,全部字符都用*代替
*/
PASSWORD(DesensitizedUtil::password),
/**
* 身份证中间10位星号替换
*/
ID_CARD(s -> s.replaceAll("(\\d{4})\\d{10}(\\d{3}[Xx]|\\d{4})", "$1** **** ****$2")),
/**
* 手机号中间4位星号替换
*/
PHONE(s -> s.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2")),
/**
* 电子邮箱,仅显示第一个字母和@后面的地址显示,其他星号替换
*/
EMAIL(s -> s.replaceAll("(^.)[^@]*(@.*$)", "$1****$2")),
/**
* 银行卡号保留最后4位其他星号替换
*/
BANK_CARD(s -> s.replaceAll("\\d{15}(\\d{3})", "**** **** **** **** $1")),
/**
* 车牌号码,包含普通车辆、新能源车辆
*/
CAR_LICENSE(DesensitizedUtil::carLicense);
private final Function<String, String> desensitizer;
DesensitizedType(Function<String, String> desensitizer)
{
this.desensitizer = desensitizer;
}
public Function<String, String> desensitizer()
{
return desensitizer;
}
}

View File

@ -0,0 +1,20 @@
package com.ruoyi.common.enums;
/**
* 限流类型
*
* @author ruoyi
*/
public enum LimitType
{
/**
* 默认策略全局限流
*/
DEFAULT,
/**
* 根据请求者IP进行限流
*/
IP
}

View File

@ -1,43 +0,0 @@
package com.ruoyi.common.exception;
/**
* 自定义异常
*
* @author ruoyi
*/
public class CustomException extends RuntimeException
{
private static final long serialVersionUID = 1L;
private Integer code;
private String message;
public CustomException(String message)
{
this.message = message;
}
public CustomException(String message, Integer code)
{
this.message = message;
this.code = code;
}
public CustomException(String message, Throwable e)
{
super(message, e);
this.message = message;
}
@Override
public String getMessage()
{
return message;
}
public Integer getCode()
{
return code;
}
}

View File

@ -0,0 +1,58 @@
package com.ruoyi.common.exception;
/**
* 全局异常
*
* @author ruoyi
*/
public class GlobalException extends RuntimeException
{
private static final long serialVersionUID = 1L;
/**
* 错误提示
*/
private String message;
/**
* 错误明细,内部调试错误
*
* 和 {@link CommonResult#getDetailMessage()} 一致的设计
*/
private String detailMessage;
/**
* 空构造方法,避免反序列化问题
*/
public GlobalException()
{
}
public GlobalException(String message)
{
this.message = message;
}
public String getDetailMessage()
{
return detailMessage;
}
public GlobalException setDetailMessage(String detailMessage)
{
this.detailMessage = detailMessage;
return this;
}
@Override
public String getMessage()
{
return message;
}
public GlobalException setMessage(String message)
{
this.message = message;
return this;
}
}

View File

@ -0,0 +1,74 @@
package com.ruoyi.common.exception;
/**
* 业务异常
*
* @author ruoyi
*/
public final class ServiceException extends RuntimeException
{
private static final long serialVersionUID = 1L;
/**
* 错误码
*/
private Integer code;
/**
* 错误提示
*/
private String message;
/**
* 错误明细,内部调试错误
*
* 和 {@link CommonResult#getDetailMessage()} 一致的设计
*/
private String detailMessage;
/**
* 空构造方法,避免反序列化问题
*/
public ServiceException()
{
}
public ServiceException(String message)
{
this.message = message;
}
public ServiceException(String message, Integer code)
{
this.message = message;
this.code = code;
}
public String getDetailMessage()
{
return detailMessage;
}
@Override
public String getMessage()
{
return message;
}
public Integer getCode()
{
return code;
}
public ServiceException setMessage(String message)
{
this.message = message;
return this;
}
public ServiceException setDetailMessage(String detailMessage)
{
this.detailMessage = detailMessage;
return this;
}
}

View File

@ -1,4 +1,4 @@
package com.ruoyi.common.exception;
package com.ruoyi.common.exception.base;
import com.ruoyi.common.utils.MessageUtils;
import com.ruoyi.common.utils.StringUtils;

View File

@ -1,6 +1,6 @@
package com.ruoyi.common.exception.file;
import com.ruoyi.common.exception.BaseException;
import com.ruoyi.common.exception.base.BaseException;
/**
* 文件信息异常类

View File

@ -0,0 +1,61 @@
package com.ruoyi.common.exception.file;
import java.io.PrintStream;
import java.io.PrintWriter;
/**
* 文件上传异常类
*
* @author ruoyi
*/
public class FileUploadException extends Exception
{
private static final long serialVersionUID = 1L;
private final Throwable cause;
public FileUploadException()
{
this(null, null);
}
public FileUploadException(final String msg)
{
this(msg, null);
}
public FileUploadException(String msg, Throwable cause)
{
super(msg);
this.cause = cause;
}
@Override
public void printStackTrace(PrintStream stream)
{
super.printStackTrace(stream);
if (cause != null)
{
stream.println("Caused by:");
cause.printStackTrace(stream);
}
}
@Override
public void printStackTrace(PrintWriter writer)
{
super.printStackTrace(writer);
if (cause != null)
{
writer.println("Caused by:");
cause.printStackTrace(writer);
}
}
@Override
public Throwable getCause()
{
return cause;
}
}

View File

@ -1,7 +1,6 @@
package com.ruoyi.common.exception.file;
import java.util.Arrays;
import org.apache.commons.fileupload.FileUploadException;
/**
* 文件上传 误异常类
@ -18,7 +17,7 @@ public class InvalidExtensionException extends FileUploadException
public InvalidExtensionException(String[] allowedExtension, String extension, String filename)
{
super("filename : [" + filename + "], extension : [" + extension + "], allowed extension : [" + Arrays.toString(allowedExtension) + "]");
super("文件[" + filename + "]后缀[" + extension + "]不正确,请上传" + Arrays.toString(allowedExtension) + "格式");
this.allowedExtension = allowedExtension;
this.extension = extension;
this.filename = filename;
@ -68,4 +67,14 @@ public class InvalidExtensionException extends FileUploadException
super(allowedExtension, extension, filename);
}
}
public static class InvalidVideoExtensionException extends InvalidExtensionException
{
private static final long serialVersionUID = 1L;
public InvalidVideoExtensionException(String[] allowedExtension, String extension, String filename)
{
super(allowedExtension, extension, filename);
}
}
}

View File

@ -0,0 +1,16 @@
package com.ruoyi.common.exception.user;
/**
* 黑名单IP异常类
*
* @author ruoyi
*/
public class BlackListException extends UserException
{
private static final long serialVersionUID = 1L;
public BlackListException()
{
super("login.blocked", null);
}
}

View File

@ -1,6 +1,6 @@
package com.ruoyi.common.exception.user;
import com.ruoyi.common.exception.BaseException;
import com.ruoyi.common.exception.base.BaseException;
/**
* 用户信息异常类

View File

@ -0,0 +1,16 @@
package com.ruoyi.common.exception.user;
/**
* 用户不存在异常类
*
* @author ruoyi
*/
public class UserNotExistsException extends UserException
{
private static final long serialVersionUID = 1L;
public UserNotExistsException()
{
super("user.not.exists", null);
}
}

View File

@ -0,0 +1,16 @@
package com.ruoyi.common.exception.user;
/**
* 用户错误最大次数异常类
*
* @author ruoyi
*/
public class UserPasswordRetryLimitExceedException extends UserException
{
private static final long serialVersionUID = 1L;
public UserPasswordRetryLimitExceedException(int retryLimitCount, int lockTime)
{
super("user.password.retry.limit.exceed", new Object[] { retryLimitCount, lockTime });
}
}

View File

@ -0,0 +1,24 @@
package com.ruoyi.common.filter;
import com.alibaba.fastjson2.filter.SimplePropertyPreFilter;
/**
* 排除JSON敏感属性
*
* @author ruoyi
*/
public class PropertyPreExcludeFilter extends SimplePropertyPreFilter
{
public PropertyPreExcludeFilter()
{
}
public PropertyPreExcludeFilter addExcludes(String... filters)
{
for (int i = 0; i < filters.length; i++)
{
this.getExcludes().add(filters[i]);
}
return this;
}
}

View File

@ -0,0 +1,77 @@
package com.ruoyi.common.filter;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* 防盗链过滤器
*
* @author ruoyi
*/
public class RefererFilter implements Filter
{
/**
* 允许的域名列表
*/
public List<String> allowedDomains;
@Override
public void init(FilterConfig filterConfig) throws ServletException
{
String domains = filterConfig.getInitParameter("allowedDomains");
this.allowedDomains = Arrays.asList(domains.split(","));
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException
{
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse resp = (HttpServletResponse) response;
String referer = req.getHeader("Referer");
// 如果Referer为空拒绝访问
if (referer == null || referer.isEmpty())
{
resp.sendError(HttpServletResponse.SC_FORBIDDEN, "Access denied: Referer header is required");
return;
}
// 检查Referer是否在允许的域名列表中
boolean allowed = false;
for (String domain : allowedDomains)
{
if (referer.contains(domain))
{
allowed = true;
break;
}
}
// 根据检查结果决定是否放行
if (allowed)
{
chain.doFilter(request, response);
}
else
{
resp.sendError(HttpServletResponse.SC_FORBIDDEN, "Access denied: Referer '" + referer + "' is not allowed");
}
}
@Override
public void destroy()
{
}
}

View File

@ -29,8 +29,8 @@ public class RepeatableFilter implements Filter
throws IOException, ServletException
{
ServletRequest requestWrapper = null;
if (request instanceof HttpServletRequest && StringUtils.equalsAnyIgnoreCase(request.getContentType(),
MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_JSON_UTF8_VALUE))
if (request instanceof HttpServletRequest
&& StringUtils.startsWithIgnoreCase(request.getContentType(), MediaType.APPLICATION_JSON_VALUE))
{
requestWrapper = new RepeatedlyRequestWrapper((HttpServletRequest) request, response);
}

View File

@ -10,6 +10,7 @@ import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import com.ruoyi.common.utils.http.HttpHelper;
import com.ruoyi.common.constant.Constants;
/**
* 构建可重复读取inputStream的request
@ -23,10 +24,10 @@ public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper
public RepeatedlyRequestWrapper(HttpServletRequest request, ServletResponse response) throws IOException
{
super(request);
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
request.setCharacterEncoding(Constants.UTF8);
response.setCharacterEncoding(Constants.UTF8);
body = HttpHelper.getBodyString(request).getBytes("UTF-8");
body = HttpHelper.getBodyString(request).getBytes(Constants.UTF8);
}
@Override
@ -38,18 +39,21 @@ public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper
@Override
public ServletInputStream getInputStream() throws IOException
{
final ByteArrayInputStream bais = new ByteArrayInputStream(body);
return new ServletInputStream()
{
@Override
public int read() throws IOException
{
return bais.read();
}
@Override
public int available() throws IOException
{
return body.length;
}
@Override
public boolean isFinished()
{

View File

@ -3,8 +3,6 @@ package com.ruoyi.common.filter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
@ -14,6 +12,7 @@ import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.enums.HttpMethod;
/**
* 防止XSS攻击的过滤器
@ -27,28 +26,18 @@ public class XssFilter implements Filter
*/
public List<String> excludes = new ArrayList<>();
/**
* xss过滤开关
*/
public boolean enabled = false;
@Override
public void init(FilterConfig filterConfig) throws ServletException
{
String tempExcludes = filterConfig.getInitParameter("excludes");
String tempEnabled = filterConfig.getInitParameter("enabled");
if (StringUtils.isNotEmpty(tempExcludes))
{
String[] url = tempExcludes.split(",");
for (int i = 0; url != null && i < url.length; i++)
String[] urls = tempExcludes.split(",");
for (String url : urls)
{
excludes.add(url[i]);
excludes.add(url);
}
}
if (StringUtils.isNotEmpty(tempEnabled))
{
enabled = Boolean.valueOf(tempEnabled);
}
}
@Override
@ -68,25 +57,14 @@ public class XssFilter implements Filter
private boolean handleExcludeURL(HttpServletRequest request, HttpServletResponse response)
{
if (!enabled)
String url = request.getServletPath();
String method = request.getMethod();
// GET DELETE 不过滤
if (method == null || HttpMethod.GET.matches(method) || HttpMethod.DELETE.matches(method))
{
return true;
}
if (excludes == null || excludes.isEmpty())
{
return false;
}
String url = request.getServletPath();
for (String pattern : excludes)
{
Pattern p = Pattern.compile("^" + pattern);
Matcher m = p.matcher(url);
if (m.find())
{
return true;
}
}
return false;
return StringUtils.matches(url, excludes);
}
@Override

View File

@ -34,13 +34,13 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper
if (values != null)
{
int length = values.length;
String[] escapseValues = new String[length];
String[] escapesValues = new String[length];
for (int i = 0; i < length; i++)
{
// 防xss攻击和过滤前后空格
escapseValues[i] = EscapeUtil.clean(values[i]).trim();
escapesValues[i] = EscapeUtil.clean(values[i]).trim();
}
return escapseValues;
return escapesValues;
}
return super.getParameterValues(name);
}
@ -63,7 +63,8 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper
// xss过滤
json = EscapeUtil.clean(json).trim();
final ByteArrayInputStream bis = new ByteArrayInputStream(json.getBytes("utf-8"));
byte[] jsonBytes = json.getBytes("utf-8");
final ByteArrayInputStream bis = new ByteArrayInputStream(jsonBytes);
return new ServletInputStream()
{
@Override
@ -78,6 +79,12 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper
return true;
}
@Override
public int available() throws IOException
{
return jsonBytes.length;
}
@Override
public void setReadListener(ReadListener readListener)
{
@ -99,7 +106,6 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper
public boolean isJsonRequest()
{
String header = super.getHeader(HttpHeaders.CONTENT_TYPE);
return MediaType.APPLICATION_JSON_VALUE.equalsIgnoreCase(header)
|| MediaType.APPLICATION_JSON_UTF8_VALUE.equalsIgnoreCase(header);
return StringUtils.startsWithIgnoreCase(header, MediaType.APPLICATION_JSON_VALUE);
}
}

View File

@ -1,114 +1,113 @@
package com.ruoyi.common.utils;
import java.math.BigDecimal;
import java.math.RoundingMode;
/**
* 精确的浮点数运算
*
* @author ruoyi
*/
public class Arith
{
/** 默认除法运算精度 */
private static final int DEF_DIV_SCALE = 10;
/** 这个类不能实例化 */
private Arith()
{
}
/**
* 提供精确的加法运算。
* @param v1 被加数
* @param v2 加数
* @return 两个参数的和
*/
public static double add(double v1, double v2)
{
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
return b1.add(b2).doubleValue();
}
/**
* 提供精确的减法运算。
* @param v1 被减数
* @param v2 减数
* @return 两个参数的差
*/
public static double sub(double v1, double v2)
{
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
return b1.subtract(b2).doubleValue();
}
/**
* 提供精确的乘法运算。
* @param v1 被乘数
* @param v2 乘数
* @return 两个参数的积
*/
public static double mul(double v1, double v2)
{
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
return b1.multiply(b2).doubleValue();
}
/**
* 提供(相对)精确的除法运算,当发生除不尽的情况时,精确到
* 小数点以后10位以后的数字四舍五入。
* @param v1 被除数
* @param v2 除数
* @return 两个参数的商
*/
public static double div(double v1, double v2)
{
return div(v1, v2, DEF_DIV_SCALE);
}
/**
* 提供相对精确的除法运算。当发生除不尽的情况时由scale参数指
* 定精度,以后的数字四舍五入。
* @param v1 被除数
* @param v2 除数
* @param scale 表示表示需要精确到小数点以后几位。
* @return 两个参数的商
*/
public static double div(double v1, double v2, int scale)
{
if (scale < 0)
{
throw new IllegalArgumentException(
"The scale must be a positive integer or zero");
}
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
if (b1.compareTo(BigDecimal.ZERO) == 0)
{
return BigDecimal.ZERO.doubleValue();
}
return b1.divide(b2, scale, RoundingMode.HALF_UP).doubleValue();
}
/**
* 提供精确的小数位四舍五入处理。
* @param v 需要四舍五入的数字
* @param scale 小数点后保留几位
* @return 四舍五入后的结果
*/
public static double round(double v, int scale)
{
if (scale < 0)
{
throw new IllegalArgumentException(
"The scale must be a positive integer or zero");
}
BigDecimal b = new BigDecimal(Double.toString(v));
BigDecimal one = new BigDecimal("1");
return b.divide(one, scale, RoundingMode.HALF_UP).doubleValue();
}
}
package com.ruoyi.common.utils;
import java.math.BigDecimal;
import java.math.RoundingMode;
/**
* 精确的浮点数运算
*
* @author ruoyi
*/
public class Arith
{
/** 默认除法运算精度 */
private static final int DEF_DIV_SCALE = 10;
/** 这个类不能实例化 */
private Arith()
{
}
/**
* 提供精确的加法运算。
* @param v1 被加数
* @param v2 加数
* @return 两个参数的和
*/
public static double add(double v1, double v2)
{
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
return b1.add(b2).doubleValue();
}
/**
* 提供精确的减法运算。
* @param v1 被减数
* @param v2 减数
* @return 两个参数的差
*/
public static double sub(double v1, double v2)
{
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
return b1.subtract(b2).doubleValue();
}
/**
* 提供精确的乘法运算。
* @param v1 被乘数
* @param v2 乘数
* @return 两个参数的积
*/
public static double mul(double v1, double v2)
{
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
return b1.multiply(b2).doubleValue();
}
/**
* 提供(相对)精确的除法运算,当发生除不尽的情况时,精确到
* 小数点以后10位以后的数字四舍五入。
* @param v1 被除数
* @param v2 除数
* @return 两个参数的商
*/
public static double div(double v1, double v2)
{
return div(v1, v2, DEF_DIV_SCALE);
}
/**
* 提供相对精确的除法运算。当发生除不尽的情况时由scale参数指
* 定精度,以后的数字四舍五入。
* @param v1 被除数
* @param v2 除数
* @param scale 表示表示需要精确到小数点以后几位。
* @return 两个参数的商
*/
public static double div(double v1, double v2, int scale)
{
if (scale < 0)
{
throw new IllegalArgumentException(
"The scale must be a positive integer or zero");
}
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
if (b1.compareTo(BigDecimal.ZERO) == 0)
{
return BigDecimal.ZERO.doubleValue();
}
return b1.divide(b2, scale, RoundingMode.HALF_UP).doubleValue();
}
/**
* 提供精确的小数位四舍五入处理。
* @param v 需要四舍五入的数字
* @param scale 小数点后保留几位
* @return 四舍五入后的结果
*/
public static double round(double v, int scale)
{
if (scale < 0)
{
throw new IllegalArgumentException(
"The scale must be a positive integer or zero");
}
BigDecimal b = new BigDecimal(Double.toString(v));
return b.divide(BigDecimal.ONE, scale, RoundingMode.HALF_UP).doubleValue();
}
}

View File

@ -3,6 +3,11 @@ package com.ruoyi.common.utils;
import java.lang.management.ManagementFactory;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Date;
import org.apache.commons.lang3.time.DateFormatUtils;
@ -22,7 +27,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
private static String[] parsePatterns = {
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
@ -121,7 +126,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
return null;
}
}
/**
* 获取服务器启动时间
*/
@ -132,16 +137,28 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
}
/**
* 计算两个时间差
* 计算相差天数
*/
public static String getDatePoor(Date endDate, Date nowDate)
public static int differentDaysByMillisecond(Date date1, Date date2)
{
return Math.abs((int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24)));
}
/**
* 计算时间差
*
* @param endDate 最后时间
* @param startTime 开始时间
* @return 时间差(天/小时/分钟)
*/
public static String timeDistance(Date endDate, Date startTime)
{
long nd = 1000 * 24 * 60 * 60;
long nh = 1000 * 60 * 60;
long nm = 1000 * 60;
// long ns = 1000;
// 获得两个时间的毫秒时间差异
long diff = endDate.getTime() - nowDate.getTime();
long diff = endDate.getTime() - startTime.getTime();
// 计算差多少天
long day = diff / nd;
// 计算差多少小时
@ -152,4 +169,23 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
// long sec = diff % nd % nh % nm / ns;
return day + "" + hour + "小时" + min + "分钟";
}
/**
* 增加 LocalDateTime ==> Date
*/
public static Date toDate(LocalDateTime temporalAccessor)
{
ZonedDateTime zdt = temporalAccessor.atZone(ZoneId.systemDefault());
return Date.from(zdt.toInstant());
}
/**
* 增加 LocalDate ==> Date
*/
public static Date toDate(LocalDate temporalAccessor)
{
LocalDateTime localDateTime = LocalDateTime.of(temporalAccessor, LocalTime.of(0, 0, 0));
ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
return Date.from(zdt.toInstant());
}
}

View File

@ -0,0 +1,49 @@
package com.ruoyi.common.utils;
/**
* 脱敏工具类
*
* @author ruoyi
*/
public class DesensitizedUtil
{
/**
* 密码的全部字符都用*代替,比如:******
*
* @param password 密码
* @return 脱敏后的密码
*/
public static String password(String password)
{
if (StringUtils.isBlank(password))
{
return StringUtils.EMPTY;
}
return StringUtils.repeat('*', password.length());
}
/**
* 车牌中间用*代替,如果是错误的车牌,不处理
*
* @param carLicense 完整的车牌号
* @return 脱敏后的车牌
*/
public static String carLicense(String carLicense)
{
if (StringUtils.isBlank(carLicense))
{
return StringUtils.EMPTY;
}
// 普通车牌
if (carLicense.length() == 7)
{
carLicense = StringUtils.hide(carLicense, 3, 6);
}
else if (carLicense.length() == 8)
{
// 新能源车牌
carLicense = StringUtils.hide(carLicense, 3, 7);
}
return carLicense;
}
}

View File

@ -1,8 +1,11 @@
package com.ruoyi.common.utils;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import com.ruoyi.common.constant.Constants;
import java.util.Map;
import com.alibaba.fastjson2.JSONArray;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.spring.SpringUtils;
@ -38,11 +41,10 @@ public class DictUtils
*/
public static List<SysDictData> getDictCache(String key)
{
Object cacheObj = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key));
if (StringUtils.isNotNull(cacheObj))
JSONArray arrayCache = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key));
if (StringUtils.isNotNull(arrayCache))
{
List<SysDictData> dictDatas = StringUtils.cast(cacheObj);
return dictDatas;
return arrayCache.toList(SysDictData.class);
}
return null;
}
@ -56,6 +58,10 @@ public class DictUtils
*/
public static String getDictLabel(String dictType, String dictValue)
{
if (StringUtils.isEmpty(dictValue))
{
return StringUtils.EMPTY;
}
return getDictLabel(dictType, dictValue, SEPARATOR);
}
@ -68,6 +74,10 @@ public class DictUtils
*/
public static String getDictValue(String dictType, String dictLabel)
{
if (StringUtils.isEmpty(dictLabel))
{
return StringUtils.EMPTY;
}
return getDictValue(dictType, dictLabel, SEPARATOR);
}
@ -81,34 +91,25 @@ public class DictUtils
*/
public static String getDictLabel(String dictType, String dictValue, String separator)
{
StringBuilder propertyString = new StringBuilder();
List<SysDictData> datas = getDictCache(dictType);
if (StringUtils.containsAny(separator, dictValue) && StringUtils.isNotEmpty(datas))
if (StringUtils.isNull(datas) || StringUtils.isEmpty(dictValue))
{
for (SysDictData dict : datas)
return StringUtils.EMPTY;
}
Map<String, String> dictMap = datas.stream().collect(HashMap::new, (map, dict) -> map.put(dict.getDictValue(), dict.getDictLabel()), Map::putAll);
if (!StringUtils.contains(dictValue, separator))
{
return dictMap.getOrDefault(dictValue, StringUtils.EMPTY);
}
StringBuilder labelBuilder = new StringBuilder();
for (String seperatedValue : dictValue.split(separator))
{
if (dictMap.containsKey(seperatedValue))
{
for (String value : dictValue.split(separator))
{
if (value.equals(dict.getDictValue()))
{
propertyString.append(dict.getDictLabel() + separator);
break;
}
}
labelBuilder.append(dictMap.get(seperatedValue)).append(separator);
}
}
else
{
for (SysDictData dict : datas)
{
if (dictValue.equals(dict.getDictValue()))
{
return dict.getDictLabel();
}
}
}
return StringUtils.stripEnd(propertyString.toString(), separator);
return StringUtils.removeEnd(labelBuilder.toString(), separator);
}
/**
@ -120,35 +121,78 @@ public class DictUtils
* @return 字典值
*/
public static String getDictValue(String dictType, String dictLabel, String separator)
{
List<SysDictData> datas = getDictCache(dictType);
if (StringUtils.isNull(datas) || StringUtils.isEmpty(dictLabel))
{
return StringUtils.EMPTY;
}
Map<String, String> dictMap = datas.stream().collect(HashMap::new, (map, dict) -> map.put(dict.getDictLabel(), dict.getDictValue()), Map::putAll);
if (!StringUtils.contains(dictLabel, separator))
{
return dictMap.getOrDefault(dictLabel, StringUtils.EMPTY);
}
StringBuilder valueBuilder = new StringBuilder();
for (String seperatedValue : dictLabel.split(separator))
{
if (dictMap.containsKey(seperatedValue))
{
valueBuilder.append(dictMap.get(seperatedValue)).append(separator);
}
}
return StringUtils.removeEnd(valueBuilder.toString(), separator);
}
/**
* 根据字典类型获取字典所有值
*
* @param dictType 字典类型
* @return 字典值
*/
public static String getDictValues(String dictType)
{
StringBuilder propertyString = new StringBuilder();
List<SysDictData> datas = getDictCache(dictType);
if (StringUtils.isNull(datas))
{
return StringUtils.EMPTY;
}
for (SysDictData dict : datas)
{
propertyString.append(dict.getDictValue()).append(SEPARATOR);
}
return StringUtils.stripEnd(propertyString.toString(), SEPARATOR);
}
if (StringUtils.containsAny(separator, dictLabel) && StringUtils.isNotEmpty(datas))
/**
* 根据字典类型获取字典所有标签
*
* @param dictType 字典类型
* @return 字典值
*/
public static String getDictLabels(String dictType)
{
StringBuilder propertyString = new StringBuilder();
List<SysDictData> datas = getDictCache(dictType);
if (StringUtils.isNull(datas))
{
for (SysDictData dict : datas)
{
for (String label : dictLabel.split(separator))
{
if (label.equals(dict.getDictLabel()))
{
propertyString.append(dict.getDictValue() + separator);
break;
}
}
}
return StringUtils.EMPTY;
}
else
for (SysDictData dict : datas)
{
for (SysDictData dict : datas)
{
if (dictLabel.equals(dict.getDictLabel()))
{
return dict.getDictValue();
}
}
propertyString.append(dict.getDictLabel()).append(SEPARATOR);
}
return StringUtils.stripEnd(propertyString.toString(), separator);
return StringUtils.stripEnd(propertyString.toString(), SEPARATOR);
}
/**
* 删除指定字典缓存
*
* @param key 字典键
*/
public static void removeDictCache(String key)
{
SpringUtils.getBean(RedisCache.class).deleteObject(getCacheKey(key));
}
/**
@ -156,7 +200,7 @@ public class DictUtils
*/
public static void clearDictCache()
{
Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys(Constants.SYS_DICT_KEY + "*");
Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys(CacheConstants.SYS_DICT_KEY + "*");
SpringUtils.getBean(RedisCache.class).deleteObject(keys);
}
@ -168,6 +212,6 @@ public class DictUtils
*/
public static String getCacheKey(String configKey)
{
return Constants.SYS_DICT_KEY + configKey;
return CacheConstants.SYS_DICT_KEY + configKey;
}
}

View File

@ -18,11 +18,10 @@ public class ExceptionUtil
{
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw, true));
String str = sw.toString();
return str;
return sw.toString();
}
public static String getRootErrorMseeage(Exception e)
public static String getRootErrorMessage(Exception e)
{
Throwable root = ExceptionUtils.getRootCause(e);
root = (root == null ? e : root);

View File

@ -0,0 +1,35 @@
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();
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
Boolean reasonable = pageDomain.getReasonable();
PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable);
}
/**
* 清理分页的线程变量
*/
public static void clearPage()
{
PageHelper.clearPage();
}
}

View File

@ -1,11 +1,17 @@
package com.ruoyi.common.utils;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.util.PatternMatchUtils;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.CustomException;
import com.ruoyi.common.exception.ServiceException;
/**
* 安全服务工具类
@ -14,6 +20,37 @@ import com.ruoyi.common.exception.CustomException;
*/
public class SecurityUtils
{
/**
* 用户ID
**/
public static Long getUserId()
{
try
{
return getLoginUser().getUserId();
}
catch (Exception e)
{
throw new ServiceException("获取用户ID异常", HttpStatus.UNAUTHORIZED);
}
}
/**
* 获取部门ID
**/
public static Long getDeptId()
{
try
{
return getLoginUser().getDeptId();
}
catch (Exception e)
{
throw new ServiceException("获取部门ID异常", HttpStatus.UNAUTHORIZED);
}
}
/**
* 获取用户账户
**/
@ -25,7 +62,7 @@ public class SecurityUtils
}
catch (Exception e)
{
throw new CustomException("获取用户账户异常", HttpStatus.UNAUTHORIZED);
throw new ServiceException("获取用户账户异常", HttpStatus.UNAUTHORIZED);
}
}
@ -40,7 +77,7 @@ public class SecurityUtils
}
catch (Exception e)
{
throw new CustomException("获取用户信息异常", HttpStatus.UNAUTHORIZED);
throw new ServiceException("获取用户信息异常", HttpStatus.UNAUTHORIZED);
}
}
@ -87,4 +124,55 @@ public class SecurityUtils
{
return userId != null && 1L == userId;
}
/**
* 验证用户是否具备某权限
*
* @param permission 权限字符串
* @return 用户是否具备某权限
*/
public static boolean hasPermi(String permission)
{
return hasPermi(getLoginUser().getPermissions(), permission);
}
/**
* 判断是否包含权限
*
* @param authorities 权限列表
* @param permission 权限字符串
* @return 用户是否具备某权限
*/
public static boolean hasPermi(Collection<String> authorities, String permission)
{
return authorities.stream().filter(StringUtils::hasText)
.anyMatch(x -> Constants.ALL_PERMISSION.equals(x) || PatternMatchUtils.simpleMatch(x, permission));
}
/**
* 验证用户是否拥有某个角色
*
* @param role 角色标识
* @return 用户是否具备某角色
*/
public static boolean hasRole(String role)
{
List<SysRole> roleList = getLoginUser().getUser().getRoles();
Collection<String> roles = roleList.stream().map(SysRole::getRoleKey).collect(Collectors.toSet());
return hasRole(roles, role);
}
/**
* 判断是否包含角色
*
* @param roles 角色列表
* @param role 角色
* @return 用户是否具备某角色权限
*/
public static boolean hasRole(Collection<String> roles, String role)
{
return roles.stream().filter(StringUtils::hasText)
.anyMatch(x -> Constants.SUPER_ADMIN.equals(x) || PatternMatchUtils.simpleMatch(x, role));
}
}

View File

@ -1,12 +1,20 @@
package com.ruoyi.common.utils;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.text.Convert;
/**
@ -48,6 +56,50 @@ public class ServletUtils
return Convert.toInt(getRequest().getParameter(name), defaultValue);
}
/**
* 获取Boolean参数
*/
public static Boolean getParameterToBool(String name)
{
return Convert.toBool(getRequest().getParameter(name));
}
/**
* 获取Boolean参数
*/
public static Boolean getParameterToBool(String name, Boolean defaultValue)
{
return Convert.toBool(getRequest().getParameter(name), defaultValue);
}
/**
* 获得所有请求参数
*
* @param request 请求对象{@link ServletRequest}
* @return Map
*/
public static Map<String, String[]> getParams(ServletRequest request)
{
final Map<String, String[]> map = request.getParameterMap();
return Collections.unmodifiableMap(map);
}
/**
* 获得所有请求参数
*
* @param request 请求对象{@link ServletRequest}
* @return Map
*/
public static Map<String, String> getParamMap(ServletRequest request)
{
Map<String, String> params = new HashMap<>();
for (Map.Entry<String, String[]> entry : getParams(request).entrySet())
{
params.put(entry.getKey(), StringUtils.join(entry.getValue(), ","));
}
return params;
}
/**
* 获取request
*/
@ -83,9 +135,8 @@ public class ServletUtils
*
* @param response 渲染对象
* @param string 待渲染的字符串
* @return null
*/
public static String renderString(HttpServletResponse response, String string)
public static void renderString(HttpServletResponse response, String string)
{
try
{
@ -98,7 +149,6 @@ public class ServletUtils
{
e.printStackTrace();
}
return null;
}
/**
@ -109,13 +159,13 @@ public class ServletUtils
public static boolean isAjaxRequest(HttpServletRequest request)
{
String accept = request.getHeader("accept");
if (accept != null && accept.indexOf("application/json") != -1)
if (accept != null && accept.contains("application/json"))
{
return true;
}
String xRequestedWith = request.getHeader("X-Requested-With");
if (xRequestedWith != null && xRequestedWith.indexOf("XMLHttpRequest") != -1)
if (xRequestedWith != null && xRequestedWith.contains("XMLHttpRequest"))
{
return true;
}
@ -127,10 +177,42 @@ public class ServletUtils
}
String ajax = request.getParameter("__ajax");
if (StringUtils.inStringIgnoreCase(ajax, "json", "xml"))
return StringUtils.inStringIgnoreCase(ajax, "json", "xml");
}
/**
* 内容编码
*
* @param str 内容
* @return 编码后的内容
*/
public static String urlEncode(String str)
{
try
{
return true;
return URLEncoder.encode(str, Constants.UTF8);
}
catch (UnsupportedEncodingException e)
{
return StringUtils.EMPTY;
}
}
/**
* 内容解码
*
* @param str 内容
* @return 解码后的内容
*/
public static String urlDecode(String str)
{
try
{
return URLDecoder.decode(str, Constants.UTF8);
}
catch (UnsupportedEncodingException e)
{
return StringUtils.EMPTY;
}
return false;
}
}

View File

@ -6,6 +6,8 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.springframework.util.AntPathMatcher;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.text.StrFormatter;
/**
@ -21,6 +23,9 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/** 下划线 */
private static final char SEPARATOR = '_';
/** 星号 */
private static final char ASTERISK = '*';
/**
* 获取参数不为空值
*
@ -161,6 +166,49 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
return (str == null ? "" : str.trim());
}
/**
* 替换指定字符串的指定区间内字符为"*"
*
* @param str 字符串
* @param startInclude 开始位置(包含)
* @param endExclude 结束位置(不包含)
* @return 替换后的字符串
*/
public static String hide(CharSequence str, int startInclude, int endExclude)
{
if (isEmpty(str))
{
return NULLSTR;
}
final int strLength = str.length();
if (startInclude > strLength)
{
return NULLSTR;
}
if (endExclude > strLength)
{
endExclude = strLength;
}
if (startInclude > endExclude)
{
// 如果起始位置大于结束位置,不替换
return NULLSTR;
}
final char[] chars = new char[strLength];
for (int i = 0; i < strLength; i++)
{
if (i >= startInclude && i < endExclude)
{
chars[i] = ASTERISK;
}
else
{
chars[i] = str.charAt(i);
}
}
return new String(chars);
}
/**
* 截取字符串
*
@ -238,6 +286,56 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
return str.substring(start, end);
}
/**
* 在字符串中查找第一个出现的 `open` 和最后一个出现的 `close` 之间的子字符串
*
* @param str 要截取的字符串
* @param open 起始字符串
* @param close 结束字符串
* @return 截取结果
*/
public static String substringBetweenLast(final String str, final String open, final String close)
{
if (isEmpty(str) || isEmpty(open) || isEmpty(close))
{
return NULLSTR;
}
final int start = str.indexOf(open);
if (start != INDEX_NOT_FOUND)
{
final int end = str.lastIndexOf(close);
if (end != INDEX_NOT_FOUND)
{
return str.substring(start + open.length(), end);
}
}
return NULLSTR;
}
/**
* 判断是否为空,并且不是空白字符
*
* @param str 要判断的value
* @return 结果
*/
public static boolean hasText(String str)
{
return (str != null && !str.isEmpty() && containsText(str));
}
private static boolean containsText(CharSequence str)
{
int strLen = str.length();
for (int i = 0; i < strLen; i++)
{
if (!Character.isWhitespace(str.charAt(i)))
{
return true;
}
}
return false;
}
/**
* 格式化文本, {} 表示占位符<br>
* 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
@ -260,6 +358,17 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
return StrFormatter.format(template, params);
}
/**
* 是否为http(s)://开头
*
* @param link 链接
* @return 结果
*/
public static boolean ishttp(String link)
{
return StringUtils.startsWithAny(link, Constants.HTTP, Constants.HTTPS);
}
/**
* 字符串转set
*
@ -272,6 +381,18 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
return new HashSet<String>(str2List(str, sep, true, false));
}
/**
* 字符串转list
*
* @param str 字符串
* @param sep 分隔符
* @return list集合
*/
public static final List<String> str2List(String str, String sep)
{
return str2List(str, sep, true, false);
}
/**
* 字符串转list
*
@ -312,7 +433,56 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
}
/**
* 下划线转驼峰命名
* 判断给定的collection列表中是否包含数组array 判断给定的数组array中是否包含给定的元素value
*
* @param collection 给定的集合
* @param array 给定的数组
* @return boolean 结果
*/
public static boolean containsAny(Collection<String> collection, String... array)
{
if (isEmpty(collection) || isEmpty(array))
{
return false;
}
else
{
for (String str : array)
{
if (collection.contains(str))
{
return true;
}
}
return false;
}
}
/**
* 查找指定字符串是否包含指定字符串列表中的任意一个字符串同时串忽略大小写
*
* @param cs 指定字符串
* @param searchCharSequences 需要检查的字符串数组
* @return 是否包含任意一个字符串
*/
public static boolean containsAnyIgnoreCase(CharSequence cs, CharSequence... searchCharSequences)
{
if (isEmpty(cs) || isEmpty(searchCharSequences))
{
return false;
}
for (CharSequence testStr : searchCharSequences)
{
if (containsIgnoreCase(cs, testStr))
{
return true;
}
}
return false;
}
/**
* 驼峰转下划线命名
*/
public static String toUnderScoreCase(String str)
{
@ -419,7 +589,8 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
}
/**
* 驼峰式命名法 例如user_name->userName
* 驼峰式命名法
* 例如user_name->userName
*/
public static String toCamelCase(String s)
{
@ -427,6 +598,10 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
{
return null;
}
if (s.indexOf(SEPARATOR) == -1)
{
return s;
}
s = s.toLowerCase();
StringBuilder sb = new StringBuilder(s.length());
boolean upperCase = false;
@ -451,9 +626,97 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
return sb.toString();
}
/**
* 查找指定字符串是否匹配指定字符串列表中的任意一个字符串
*
* @param str 指定字符串
* @param strs 需要检查的字符串数组
* @return 是否匹配
*/
public static boolean matches(String str, List<String> strs)
{
if (isEmpty(str) || isEmpty(strs))
{
return false;
}
for (String pattern : strs)
{
if (isMatch(pattern, str))
{
return true;
}
}
return false;
}
/**
* 判断url是否与规则配置:
* ? 表示单个字符;
* * 表示一层路径内的任意字符串,不可跨层级;
* ** 表示任意层路径;
*
* @param pattern 匹配规则
* @param url 需要匹配的url
* @return
*/
public static boolean isMatch(String pattern, String url)
{
AntPathMatcher matcher = new AntPathMatcher();
return matcher.match(pattern, url);
}
@SuppressWarnings("unchecked")
public static <T> T cast(Object obj)
{
return (T) obj;
}
/**
* 数字左边补齐0使之达到指定长度。注意如果数字转换为字符串后长度大于size则只保留 最后size个字符。
*
* @param num 数字对象
* @param size 字符串指定长度
* @return 返回数字的字符串格式,该字符串为指定长度。
*/
public static final String padl(final Number num, final int size)
{
return padl(num.toString(), size, '0');
}
/**
* 字符串左补齐。如果原始字符串s长度大于size则只保留最后size个字符。
*
* @param s 原始字符串
* @param size 字符串指定长度
* @param c 用于补齐的字符
* @return 返回指定长度的字符串,由原字符串左补齐或截取得到。
*/
public static final String padl(final String s, final int size, final char c)
{
final StringBuilder sb = new StringBuilder(size);
if (s != null)
{
final int len = s.length();
if (s.length() <= size)
{
for (int i = size - len; i > 0; i--)
{
sb.append(c);
}
sb.append(s);
}
else
{
return s.substring(len - size, len);
}
}
else
{
for (int i = size; i > 0; i--)
{
sb.append(c);
}
}
return sb.toString();
}
}

Some files were not shown because too many files have changed in this diff Show More