diff --git a/README.md b/README.md
index c103879eb..c91056066 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
[](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/blob/master/LICENSE)
[](https://www.jetbrains.com/?from=RuoYi-Vue-Plus)
-[](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus)
+[](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus)
[]()
[]()
[]()
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index 1535f3d6f..e676d5607 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -103,7 +103,7 @@ services:
ipv4_address: 172.30.0.54
ruoyi-server1:
- image: "ruoyi/ruoyi-server:3.1.0"
+ image: "ruoyi/ruoyi-server:3.2.0"
container_name: ruoyi-server1
environment:
# 时区上海
@@ -118,7 +118,7 @@ services:
ipv4_address: 172.30.0.60
ruoyi-server2:
- image: "ruoyi/ruoyi-server:3.1.0"
+ image: "ruoyi/ruoyi-server:3.2.0"
container_name: ruoyi-server2
environment:
# 时区上海
@@ -133,7 +133,7 @@ services:
ipv4_address: 172.30.0.61
ruoyi-monitor-admin:
- image: "ruoyi/ruoyi-monitor-admin:3.1.0"
+ image: "ruoyi/ruoyi-monitor-admin:3.2.0"
container_name: ruoyi-monitor-admin
environment:
# 时区上海
diff --git a/pom.xml b/pom.xml
index c6cb0242c..c6db86863 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,14 +6,14 @@
com.ruoyi
ruoyi-vue-plus
- 3.1.0
+ 3.2.0
RuoYi-Vue-Plus
https://gitee.com/JavaLionLi/RuoYi-Vue-Plus
RuoYi-Vue-Plus后台管理系统
- 3.1.0
+ 3.2.0
2.5.5
UTF-8
UTF-8
diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml
index 37cc33b11..12327e305 100644
--- a/ruoyi-admin/pom.xml
+++ b/ruoyi-admin/pom.xml
@@ -5,7 +5,7 @@
ruoyi-vue-plus
com.ruoyi
- 3.1.0
+ 3.2.0
4.0.0
jar
@@ -87,7 +87,7 @@
org.apache.maven.plugins
maven-war-plugin
- 3.1.0
+ 3.2.0
false
${project.artifactId}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssController.java
index 4acc3116c..bd1dcb69b 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssController.java
@@ -102,7 +102,7 @@ public class SysOssController extends BaseController {
response.reset();
response.addHeader("Access-Control-Allow-Origin", "*");
response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
- FileUtils.setAttachmentResponseHeader(response, URLEncoder.encode(sysOss.getOriginalName(), StandardCharsets.UTF_8.toString()));
+ FileUtils.setAttachmentResponseHeader(response, sysOss.getOriginalName());
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE + "; charset=UTF-8");
long data;
try {
diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml
index 310e0ed15..1d1bd80bf 100644
--- a/ruoyi-common/pom.xml
+++ b/ruoyi-common/pom.xml
@@ -5,7 +5,7 @@
ruoyi-vue-plus
com.ruoyi
- 3.1.0
+ 3.2.0
4.0.0
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
index 4060b1794..e3001c605 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
@@ -46,7 +46,7 @@ public class ExcelUtil {
response.reset();
response.addHeader("Access-Control-Allow-Origin", "*");
response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
- FileUtils.setAttachmentResponseHeader(response, URLEncoder.encode(filename, StandardCharsets.UTF_8.toString()));
+ FileUtils.setAttachmentResponseHeader(response, filename);
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8");
ServletOutputStream os = response.getOutputStream();
EasyExcel.write(os, clazz)
diff --git a/ruoyi-demo/pom.xml b/ruoyi-demo/pom.xml
index 2eff3c2db..339cbde44 100644
--- a/ruoyi-demo/pom.xml
+++ b/ruoyi-demo/pom.xml
@@ -5,7 +5,7 @@
ruoyi-vue-plus
com.ruoyi
- 3.1.0
+ 3.2.0
4.0.0
diff --git a/ruoyi-extend/pom.xml b/ruoyi-extend/pom.xml
index 2a348af4a..6378eb9b8 100644
--- a/ruoyi-extend/pom.xml
+++ b/ruoyi-extend/pom.xml
@@ -5,7 +5,7 @@
ruoyi-vue-plus
com.ruoyi
- 3.1.0
+ 3.2.0
4.0.0
ruoyi-extend
diff --git a/ruoyi-extend/ruoyi-monitor-admin/pom.xml b/ruoyi-extend/ruoyi-monitor-admin/pom.xml
index dc0830373..d63b110b9 100644
--- a/ruoyi-extend/ruoyi-monitor-admin/pom.xml
+++ b/ruoyi-extend/ruoyi-monitor-admin/pom.xml
@@ -5,7 +5,7 @@
ruoyi-extend
com.ruoyi
- 3.1.0
+ 3.2.0
4.0.0
jar
diff --git a/ruoyi-framework/pom.xml b/ruoyi-framework/pom.xml
index 7010724b1..20176a0be 100644
--- a/ruoyi-framework/pom.xml
+++ b/ruoyi-framework/pom.xml
@@ -5,7 +5,7 @@
ruoyi-vue-plus
com.ruoyi
- 3.1.0
+ 3.2.0
4.0.0
diff --git a/ruoyi-generator/pom.xml b/ruoyi-generator/pom.xml
index d5bdc7e53..e19cbb293 100644
--- a/ruoyi-generator/pom.xml
+++ b/ruoyi-generator/pom.xml
@@ -5,7 +5,7 @@
ruoyi-vue-plus
com.ruoyi
- 3.1.0
+ 3.2.0
4.0.0
diff --git a/ruoyi-oss/pom.xml b/ruoyi-oss/pom.xml
index 51111c1c7..6c93df8e0 100644
--- a/ruoyi-oss/pom.xml
+++ b/ruoyi-oss/pom.xml
@@ -5,7 +5,7 @@
ruoyi-vue-plus
com.ruoyi
- 3.1.0
+ 3.2.0
4.0.0
diff --git a/ruoyi-quartz/pom.xml b/ruoyi-quartz/pom.xml
index cba3e92f5..ee682f717 100644
--- a/ruoyi-quartz/pom.xml
+++ b/ruoyi-quartz/pom.xml
@@ -5,7 +5,7 @@
ruoyi-vue-plus
com.ruoyi
- 3.1.0
+ 3.2.0
4.0.0
diff --git a/ruoyi-system/pom.xml b/ruoyi-system/pom.xml
index 8d1d85f83..e7c12ef14 100644
--- a/ruoyi-system/pom.xml
+++ b/ruoyi-system/pom.xml
@@ -5,7 +5,7 @@
ruoyi-vue-plus
com.ruoyi
- 3.1.0
+ 3.2.0
4.0.0
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/SysLoginService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/SysLoginService.java
index e44d31b91..fb8273ab9 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/SysLoginService.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/SysLoginService.java
@@ -13,7 +13,7 @@ import com.ruoyi.common.utils.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
-import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
@@ -23,57 +23,48 @@ import javax.servlet.http.HttpServletRequest;
* @author ruoyi
*/
@Slf4j
-@Component
-public class SysLoginService
-{
+@Service
+public class SysLoginService {
- @Autowired
+ @Autowired
private ISysUserService userService;
- @Autowired
- private ISysConfigService configService;
+ @Autowired
+ private ISysConfigService configService;
- @Autowired
- private LogininforService asyncService;
+ @Autowired
+ private LogininforService asyncService;
/**
* 登录验证
*
* @param username 用户名
* @param password 密码
- * @param code 验证码
- * @param uuid 唯一标识
+ * @param code 验证码
+ * @param uuid 唯一标识
* @return 结果
*/
- public String login(String username, String password, String code, String uuid)
- {
- HttpServletRequest request = ServletUtils.getRequest();
- boolean captchaOnOff = configService.selectCaptchaOnOff();
+ public String login(String username, String password, String code, String uuid) {
+ HttpServletRequest request = ServletUtils.getRequest();
+ boolean captchaOnOff = configService.selectCaptchaOnOff();
// 验证码开关
- if (captchaOnOff)
- {
+ if (captchaOnOff) {
validateCaptcha(username, code, uuid, request);
}
SysUser user = userService.selectUserByUserName(username);
- if (StringUtils.isNull(user))
- {
+ if (StringUtils.isNull(user)) {
log.info("登录用户:{} 不存在.", username);
throw new ServiceException("登录用户:" + username + " 不存在");
- }
- else if (UserStatus.DELETED.getCode().equals(user.getDelFlag()))
- {
+ } else if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) {
log.info("登录用户:{} 已被删除.", username);
throw new ServiceException("对不起,您的账号:" + username + " 已被删除");
- }
- else if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
- {
+ } else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) {
log.info("登录用户:{} 已被停用.", username);
throw new ServiceException("对不起,您的账号:" + username + " 已停用");
}
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
String encodePassword = passwordEncoder.encode(password);
- if (SecurityUtils.matchesPassword(user.getPassword(), encodePassword))
- {
+ if (SecurityUtils.matchesPassword(user.getPassword(), encodePassword)) {
asyncService.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"), request);
throw new UserPasswordNotMatchException();
}
@@ -89,22 +80,22 @@ public class SysLoginService
* 校验验证码
*
* @param username 用户名
- * @param code 验证码
- * @param uuid 唯一标识
+ * @param code 验证码
+ * @param uuid 唯一标识
* @return 结果
*/
public void validateCaptcha(String username, String code, String uuid, HttpServletRequest request) {
- String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
- String captcha = RedisUtils.getCacheObject(verifyKey);
+ String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
+ String captcha = RedisUtils.getCacheObject(verifyKey);
RedisUtils.deleteObject(verifyKey);
- if (captcha == null) {
- asyncService.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"), request);
- throw new CaptchaExpireException();
- }
- if (!code.equalsIgnoreCase(captcha)) {
- asyncService.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"), request);
- throw new CaptchaException();
- }
+ if (captcha == null) {
+ asyncService.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"), request);
+ throw new CaptchaExpireException();
+ }
+ if (!code.equalsIgnoreCase(captcha)) {
+ asyncService.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"), request);
+ throw new CaptchaException();
+ }
}
/**
@@ -112,8 +103,7 @@ public class SysLoginService
*
* @param userId 用户ID
*/
- public void recordLoginInfo(Long userId)
- {
+ public void recordLoginInfo(Long userId) {
SysUser sysUser = new SysUser();
sysUser.setUserId(userId);
sysUser.setLoginIp(ServletUtils.getClientIP());
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/SysPermissionService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/SysPermissionService.java
index d8c657b5b..095b3b566 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/SysPermissionService.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/SysPermissionService.java
@@ -2,19 +2,19 @@ package com.ruoyi.system.service;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
import java.util.HashSet;
import java.util.Set;
/**
* 用户权限处理
- *
+ *
* @author ruoyi
*/
-@Component
-public class SysPermissionService
-{
+@Service
+public class SysPermissionService {
+
@Autowired
private ISysRoleService roleService;
@@ -23,20 +23,16 @@ public class SysPermissionService
/**
* 获取角色数据权限
- *
+ *
* @param user 用户信息
* @return 角色权限信息
*/
- public Set getRolePermission(SysUser user)
- {
+ public Set getRolePermission(SysUser user) {
Set roles = new HashSet();
// 管理员拥有所有权限
- if (user.isAdmin())
- {
+ if (user.isAdmin()) {
roles.add("admin");
- }
- else
- {
+ } else {
roles.addAll(roleService.selectRolePermissionByUserId(user.getUserId()));
}
return roles;
@@ -44,20 +40,16 @@ public class SysPermissionService
/**
* 获取菜单数据权限
- *
+ *
* @param user 用户信息
* @return 菜单权限信息
*/
- public Set getMenuPermission(SysUser user)
- {
+ public Set getMenuPermission(SysUser user) {
Set perms = new HashSet();
// 管理员拥有所有权限
- if (user.isAdmin())
- {
+ if (user.isAdmin()) {
perms.add("*:*:*");
- }
- else
- {
+ } else {
perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId()));
}
return perms;
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRegisterService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRegisterService.java
index 8171cb079..045c680c3 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRegisterService.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRegisterService.java
@@ -9,75 +9,59 @@ import com.ruoyi.common.exception.user.CaptchaException;
import com.ruoyi.common.exception.user.CaptchaExpireException;
import com.ruoyi.common.utils.*;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
/**
* 注册校验方法
*
* @author ruoyi
*/
-@Component
-public class SysRegisterService
-{
+@Service
+public class SysRegisterService {
+
@Autowired
private ISysUserService userService;
@Autowired
private ISysConfigService configService;
- @Autowired
- private LogininforService asyncService;
+ @Autowired
+ private LogininforService asyncService;
/**
* 注册
*/
- public String register(RegisterBody registerBody)
- {
+ public String register(RegisterBody registerBody) {
String msg = "", username = registerBody.getUsername(), password = registerBody.getPassword();
boolean captchaOnOff = configService.selectCaptchaOnOff();
// 验证码开关
- if (captchaOnOff)
- {
+ if (captchaOnOff) {
validateCaptcha(username, registerBody.getCode(), registerBody.getUuid());
}
- if (StringUtils.isEmpty(username))
- {
+ if (StringUtils.isEmpty(username)) {
msg = "用户名不能为空";
- }
- else if (StringUtils.isEmpty(password))
- {
+ } else if (StringUtils.isEmpty(password)) {
msg = "用户密码不能为空";
- }
- else if (username.length() < UserConstants.USERNAME_MIN_LENGTH
- || username.length() > UserConstants.USERNAME_MAX_LENGTH)
- {
+ } else if (username.length() < UserConstants.USERNAME_MIN_LENGTH
+ || username.length() > UserConstants.USERNAME_MAX_LENGTH) {
msg = "账户长度必须在2到20个字符之间";
- }
- else if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
- || password.length() > UserConstants.PASSWORD_MAX_LENGTH)
- {
+ } else if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
+ || password.length() > UserConstants.PASSWORD_MAX_LENGTH) {
msg = "密码长度必须在5到20个字符之间";
- }
- else if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(username)))
- {
+ } else if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(username))) {
msg = "保存用户'" + username + "'失败,注册账号已存在";
- }
- else
- {
+ } else {
SysUser sysUser = new SysUser();
sysUser.setUserName(username);
sysUser.setNickName(username);
sysUser.setPassword(SecurityUtils.encryptPassword(registerBody.getPassword()));
boolean regFlag = userService.registerUser(sysUser);
- if (!regFlag)
- {
+ if (!regFlag) {
msg = "注册失败,请联系系统管理人员";
- }
- else
- {
- asyncService.recordLogininfor(username, Constants.REGISTER,
+ } else {
+ asyncService.recordLogininfor(username, Constants.REGISTER,
MessageUtils.message("user.register.success"), ServletUtils.getRequest());
}
}
@@ -88,21 +72,18 @@ public class SysRegisterService
* 校验验证码
*
* @param username 用户名
- * @param code 验证码
- * @param uuid 唯一标识
+ * @param code 验证码
+ * @param uuid 唯一标识
* @return 结果
*/
- public void validateCaptcha(String username, String code, String uuid)
- {
+ public void validateCaptcha(String username, String code, String uuid) {
String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
String captcha = RedisUtils.getCacheObject(verifyKey);
RedisUtils.deleteObject(verifyKey);
- if (captcha == null)
- {
+ if (captcha == null) {
throw new CaptchaExpireException();
}
- if (!code.equalsIgnoreCase(captcha))
- {
+ if (!code.equalsIgnoreCase(captcha)) {
throw new CaptchaException();
}
}
diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json
index d43aee1d1..1189455a3 100644
--- a/ruoyi-ui/package.json
+++ b/ruoyi-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "ruoyi-vue-plus",
- "version": "3.1.0",
+ "version": "3.2.0",
"description": "RuoYi-Vue-Plus后台管理系统",
"author": "LionLi",
"license": "MIT",
@@ -71,8 +71,8 @@
"eslint-plugin-vue": "7.2.0",
"lint-staged": "10.5.3",
"runjs": "4.4.2",
- "sass": "1.42.1",
- "sass-loader": "10.1.0",
+ "sass": "1.32.13",
+ "sass-loader": "10.1.1",
"script-ext-html-webpack-plugin": "2.1.5",
"svg-sprite-loader": "5.1.1",
"vue-template-compiler": "2.6.12"
diff --git a/ruoyi-ui/src/plugins/download.js b/ruoyi-ui/src/plugins/download.js
index 248ed01c8..50f664a53 100644
--- a/ruoyi-ui/src/plugins/download.js
+++ b/ruoyi-ui/src/plugins/download.js
@@ -40,7 +40,7 @@ export default {
this.saveAs(blob, decodeURI(res.headers['download-filename']))
})
},
- oss(ossId, name) {
+ oss(ossId) {
var url = baseURL + '/system/oss/download/' + ossId
axios({
method: 'get',
@@ -49,7 +49,7 @@ export default {
headers: { 'Authorization': 'Bearer ' + getToken() }
}).then(res => {
const blob = new Blob([res.data], { type: 'application/octet-stream' })
- this.saveAs(blob, name)
+ this.saveAs(blob, decodeURI(res.headers['download-filename']))
})
},
zip(url, name) {
diff --git a/ruoyi-ui/src/views/index.vue b/ruoyi-ui/src/views/index.vue
index 3d90e4549..ae96e9954 100644
--- a/ruoyi-ui/src/views/index.vue
+++ b/ruoyi-ui/src/views/index.vue
@@ -93,6 +93,47 @@
更新日志
+
+
+ - update [重大改动]接口文档 支持分组配置
+ - update [重大改动]security 路径配置抽取到配置文件
+ - update [重大改动] 将 framework 与 system 模块 解耦 调整依赖结构 解决依赖冲突
+ - update [重大改动]重写 防重提交实现 使用分布式锁 解决并发问题 压测通过
+ - update springboot 2.5.4 => 2.5.5 bugfix版本
+ - update mybatis-plus 3.4.3.3 => 3.4.3.4 bugfix版本
+ - update redisson 3.16.2 => 3.16.3 bugfix版本
+ - update easyexcel 2.2.10 => 2.2.11
+ - update hutool 5.7.11 => 5.7.13
+ - update file-saver 2.0.4 => 2.0.5
+ - update dart-sass 1.32.0 => 1.32.13
+ - update sass-loader 10.1.0 => 10.1.1
+ - update 优化代码生成 根据MP生成特性 调整导入表结构默认值合理化
+ - update 将所有 云存储字样 改为 对象存储 避免误解
+ - update 更新 @Cacheable 错误用法 注意事项
+ - update 优化 AddressUtils 空校验处理
+ - update 菜单管理支持配置路由参数
+ - update 优化aop语法 使用spring自动注入注解
+ - update 使用 Redisson 限流工具 重写限流实现
+ - update 使用 vue-data-dict 简化数据字典使用
+ - update 增加日志注解新增是否保存响应参数开关
+ - update 用户未登录日志改为 warn 级别
+ - update OSS模块 关于下载403报错信息优化
+ - update 更新 Actuator prod 默认暴漏端点 增加暴漏 logfile 日志端点
+ - update 默认适配jdk11 测试 jdk17 无异常
+ - update 封装通用下载方法简化下载使用
+ - add 新增通用方法简化模态/缓存使用
+ - add 增加 限流演示案例
+ - add 增加 redis redisson 集群配置
+ - fix Cron表达式生成器关闭时销毁,避免再次打开时存在上一次修改的数据
+ - fix 全局限流key会多出一个"-" 将其移动到IP后面 去除多余的空格
+ - fix 修复多主键代码生成bug
+ - fix 修复 @Cacheable 与 @DataScope 冲突问题
+ - fix 修复代码生成页面数据编辑保存之后总是跳转第一页的问题
+ - remove 移除过期工具 RedisCache
+ - remove 移除无用配置类 ServerConfig
+ - remove 移除 SysUser 无用字段 salt
+
+
- add [重大改动] 过期 RedisCache 新增 RedisUtils 工具类 新增 发布订阅功能 更灵巧便于使用