mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-19 01:48:47 +08:00
Merge branch 'dev' into warm-flow-future
This commit is contained in:
commit
78e2562e2a
@ -1,5 +1,5 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="ruoyi-server" type="docker-deploy" factoryName="dockerfile" server-name="演示机">
|
<configuration default="false" name="ruoyi-server" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
|
||||||
<deployment type="dockerfile">
|
<deployment type="dockerfile">
|
||||||
<settings>
|
<settings>
|
||||||
<option name="imageTag" value="ruoyi/ruoyi-server:5.2.3" />
|
<option name="imageTag" value="ruoyi/ruoyi-server:5.2.3" />
|
||||||
|
|||||||
@ -22,7 +22,9 @@
|
|||||||
|
|
||||||
> 系统演示: [传送门](https://plus-doc.dromara.org/#/common/demo_system)
|
> 系统演示: [传送门](https://plus-doc.dromara.org/#/common/demo_system)
|
||||||
|
|
||||||
> 前端项目地址: [plus-ui](https://gitee.com/JavaLionLi/plus-ui)
|
> 官方前端项目地址: [plus-ui](https://gitee.com/JavaLionLi/plus-ui)<br>
|
||||||
|
> 成员前端项目地址: 基于vben [ruoyi-plus-vben](https://gitee.com/dapppp/ruoyi-plus-vben)<br>
|
||||||
|
> 成员前端项目地址: 基于vben5 [ruoyi-plus-vben5](https://gitee.com/dapppp/ruoyi-plus-vben5)
|
||||||
|
|
||||||
> 文档地址: [plus-doc](https://plus-doc.dromara.org)
|
> 文档地址: [plus-doc](https://plus-doc.dromara.org)
|
||||||
|
|
||||||
|
|||||||
6
pom.xml
6
pom.xml
@ -19,7 +19,7 @@
|
|||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<java.version>17</java.version>
|
<java.version>17</java.version>
|
||||||
<mybatis.version>3.5.16</mybatis.version>
|
<mybatis.version>3.5.16</mybatis.version>
|
||||||
<springdoc.version>2.6.0</springdoc.version>
|
<springdoc.version>2.7.0</springdoc.version>
|
||||||
<therapi-javadoc.version>0.15.0</therapi-javadoc.version>
|
<therapi-javadoc.version>0.15.0</therapi-javadoc.version>
|
||||||
<easyexcel.version>4.0.3</easyexcel.version>
|
<easyexcel.version>4.0.3</easyexcel.version>
|
||||||
<velocity.version>2.3</velocity.version>
|
<velocity.version>2.3</velocity.version>
|
||||||
@ -28,10 +28,10 @@
|
|||||||
<p6spy.version>3.9.1</p6spy.version>
|
<p6spy.version>3.9.1</p6spy.version>
|
||||||
<hutool.version>5.8.31</hutool.version>
|
<hutool.version>5.8.31</hutool.version>
|
||||||
<spring-boot-admin.version>3.3.4</spring-boot-admin.version>
|
<spring-boot-admin.version>3.3.4</spring-boot-admin.version>
|
||||||
<redisson.version>3.37.0</redisson.version>
|
<redisson.version>3.39.0</redisson.version>
|
||||||
<lock4j.version>2.2.7</lock4j.version>
|
<lock4j.version>2.2.7</lock4j.version>
|
||||||
<dynamic-ds.version>4.3.1</dynamic-ds.version>
|
<dynamic-ds.version>4.3.1</dynamic-ds.version>
|
||||||
<snailjob.version>1.1.2</snailjob.version>
|
<snailjob.version>1.2.0</snailjob.version>
|
||||||
<mapstruct-plus.version>1.4.5</mapstruct-plus.version>
|
<mapstruct-plus.version>1.4.5</mapstruct-plus.version>
|
||||||
<mapstruct-plus.lombok.version>0.2.0</mapstruct-plus.lombok.version>
|
<mapstruct-plus.lombok.version>0.2.0</mapstruct-plus.lombok.version>
|
||||||
<lombok.version>1.18.34</lombok.version>
|
<lombok.version>1.18.34</lombok.version>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# 贝尔实验室 Spring 官方推荐镜像 JDK下载地址 https://bell-sw.com/pages/downloads/
|
# 贝尔实验室 Spring 官方推荐镜像 JDK下载地址 https://bell-sw.com/pages/downloads/
|
||||||
FROM bellsoft/liberica-openjdk-debian:17.0.11-cds
|
FROM bellsoft/liberica-openjdk-debian:17.0.11-cds
|
||||||
#FROM bellsoft/liberica-openjdk-debian:21.0.3-cds
|
#FROM bellsoft/liberica-openjdk-debian:21.0.5-cds
|
||||||
#FROM findepi/graalvm:java17-native
|
#FROM findepi/graalvm:java17-native
|
||||||
|
|
||||||
LABEL maintainer="Lion Li"
|
LABEL maintainer="Lion Li"
|
||||||
@ -17,6 +17,8 @@ EXPOSE ${SERVER_PORT}
|
|||||||
|
|
||||||
ADD ./target/ruoyi-admin.jar ./app.jar
|
ADD ./target/ruoyi-admin.jar ./app.jar
|
||||||
|
|
||||||
|
SHELL ["/bin/bash", "-c"]
|
||||||
|
|
||||||
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} \
|
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} \
|
||||||
# 应用名称 如果想区分集群节点监控 改成不同的名称即可
|
# 应用名称 如果想区分集群节点监控 改成不同的名称即可
|
||||||
#-Dskywalking.agent.service_name=ruoyi-server \
|
#-Dskywalking.agent.service_name=ruoyi-server \
|
||||||
|
|||||||
@ -228,12 +228,12 @@ public class SysLoginService {
|
|||||||
if (!TenantHelper.isEnable()) {
|
if (!TenantHelper.isEnable()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (TenantConstants.DEFAULT_TENANT_ID.equals(tenantId)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (StringUtils.isBlank(tenantId)) {
|
if (StringUtils.isBlank(tenantId)) {
|
||||||
throw new TenantException("tenant.number.not.blank");
|
throw new TenantException("tenant.number.not.blank");
|
||||||
}
|
}
|
||||||
|
if (TenantConstants.DEFAULT_TENANT_ID.equals(tenantId)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
SysTenantVo tenant = tenantService.queryByTenantId(tenantId);
|
SysTenantVo tenant = tenantService.queryByTenantId(tenantId);
|
||||||
if (ObjectUtil.isNull(tenant)) {
|
if (ObjectUtil.isNull(tenant)) {
|
||||||
log.info("登录租户:{} 不存在.", tenantId);
|
log.info("登录租户:{} 不存在.", tenantId);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
spring.boot.admin.client:
|
spring.boot.admin.client:
|
||||||
# 增加客户端开关
|
# 增加客户端开关
|
||||||
enabled: true
|
enabled: true
|
||||||
url: http://localhost:9090/admin
|
url: http://localhost:9090
|
||||||
instance:
|
instance:
|
||||||
service-host-type: IP
|
service-host-type: IP
|
||||||
metadata:
|
metadata:
|
||||||
|
|||||||
@ -5,7 +5,7 @@ spring.servlet.multipart.location: /ruoyi/server/temp
|
|||||||
spring.boot.admin.client:
|
spring.boot.admin.client:
|
||||||
# 增加客户端开关
|
# 增加客户端开关
|
||||||
enabled: true
|
enabled: true
|
||||||
url: http://localhost:9090/admin
|
url: http://localhost:9090
|
||||||
instance:
|
instance:
|
||||||
service-host-type: IP
|
service-host-type: IP
|
||||||
metadata:
|
metadata:
|
||||||
|
|||||||
@ -47,6 +47,7 @@ logging:
|
|||||||
org.dromara: @logging.level@
|
org.dromara: @logging.level@
|
||||||
org.springframework: warn
|
org.springframework: warn
|
||||||
org.mybatis.spring.mapper: error
|
org.mybatis.spring.mapper: error
|
||||||
|
org.apache.fury: warn
|
||||||
config: classpath:logback-plus.xml
|
config: classpath:logback-plus.xml
|
||||||
|
|
||||||
# 用户配置
|
# 用户配置
|
||||||
|
|||||||
@ -25,7 +25,7 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客户端工具类
|
* 客户端工具类,提供获取请求参数、响应处理、头部信息等常用操作
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@ -33,52 +33,73 @@ import java.util.Map;
|
|||||||
public class ServletUtils extends JakartaServletUtil {
|
public class ServletUtils extends JakartaServletUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取String参数
|
* 获取指定名称的 String 类型的请求参数
|
||||||
|
*
|
||||||
|
* @param name 参数名
|
||||||
|
* @return 参数值
|
||||||
*/
|
*/
|
||||||
public static String getParameter(String name) {
|
public static String getParameter(String name) {
|
||||||
return getRequest().getParameter(name);
|
return getRequest().getParameter(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取String参数
|
* 获取指定名称的 String 类型的请求参数,若参数不存在,则返回默认值
|
||||||
|
*
|
||||||
|
* @param name 参数名
|
||||||
|
* @param defaultValue 默认值
|
||||||
|
* @return 参数值或默认值
|
||||||
*/
|
*/
|
||||||
public static String getParameter(String name, String defaultValue) {
|
public static String getParameter(String name, String defaultValue) {
|
||||||
return Convert.toStr(getRequest().getParameter(name), defaultValue);
|
return Convert.toStr(getRequest().getParameter(name), defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取Integer参数
|
* 获取指定名称的 Integer 类型的请求参数
|
||||||
|
*
|
||||||
|
* @param name 参数名
|
||||||
|
* @return 参数值
|
||||||
*/
|
*/
|
||||||
public static Integer getParameterToInt(String name) {
|
public static Integer getParameterToInt(String name) {
|
||||||
return Convert.toInt(getRequest().getParameter(name));
|
return Convert.toInt(getRequest().getParameter(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取Integer参数
|
* 获取指定名称的 Integer 类型的请求参数,若参数不存在,则返回默认值
|
||||||
|
*
|
||||||
|
* @param name 参数名
|
||||||
|
* @param defaultValue 默认值
|
||||||
|
* @return 参数值或默认值
|
||||||
*/
|
*/
|
||||||
public static Integer getParameterToInt(String name, Integer defaultValue) {
|
public static Integer getParameterToInt(String name, Integer defaultValue) {
|
||||||
return Convert.toInt(getRequest().getParameter(name), defaultValue);
|
return Convert.toInt(getRequest().getParameter(name), defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取Boolean参数
|
* 获取指定名称的 Boolean 类型的请求参数
|
||||||
|
*
|
||||||
|
* @param name 参数名
|
||||||
|
* @return 参数值
|
||||||
*/
|
*/
|
||||||
public static Boolean getParameterToBool(String name) {
|
public static Boolean getParameterToBool(String name) {
|
||||||
return Convert.toBool(getRequest().getParameter(name));
|
return Convert.toBool(getRequest().getParameter(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取Boolean参数
|
* 获取指定名称的 Boolean 类型的请求参数,若参数不存在,则返回默认值
|
||||||
|
*
|
||||||
|
* @param name 参数名
|
||||||
|
* @param defaultValue 默认值
|
||||||
|
* @return 参数值或默认值
|
||||||
*/
|
*/
|
||||||
public static Boolean getParameterToBool(String name, Boolean defaultValue) {
|
public static Boolean getParameterToBool(String name, Boolean defaultValue) {
|
||||||
return Convert.toBool(getRequest().getParameter(name), defaultValue);
|
return Convert.toBool(getRequest().getParameter(name), defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得所有请求参数
|
* 获取所有请求参数(以 Map 的形式返回)
|
||||||
*
|
*
|
||||||
* @param request 请求对象{@link ServletRequest}
|
* @param request 请求对象{@link ServletRequest}
|
||||||
* @return Map
|
* @return 请求参数的 Map,键为参数名,值为参数值数组
|
||||||
*/
|
*/
|
||||||
public static Map<String, String[]> getParams(ServletRequest request) {
|
public static Map<String, String[]> getParams(ServletRequest request) {
|
||||||
final Map<String, String[]> map = request.getParameterMap();
|
final Map<String, String[]> map = request.getParameterMap();
|
||||||
@ -86,10 +107,10 @@ public class ServletUtils extends JakartaServletUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得所有请求参数
|
* 获取所有请求参数(以 Map 的形式返回,值为字符串形式的拼接)
|
||||||
*
|
*
|
||||||
* @param request 请求对象{@link ServletRequest}
|
* @param request 请求对象{@link ServletRequest}
|
||||||
* @return Map
|
* @return 请求参数的 Map,键为参数名,值为拼接后的字符串
|
||||||
*/
|
*/
|
||||||
public static Map<String, String> getParamMap(ServletRequest request) {
|
public static Map<String, String> getParamMap(ServletRequest request) {
|
||||||
Map<String, String> params = new HashMap<>();
|
Map<String, String> params = new HashMap<>();
|
||||||
@ -100,7 +121,9 @@ public class ServletUtils extends JakartaServletUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取request
|
* 获取当前 HTTP 请求对象
|
||||||
|
*
|
||||||
|
* @return 当前 HTTP 请求对象
|
||||||
*/
|
*/
|
||||||
public static HttpServletRequest getRequest() {
|
public static HttpServletRequest getRequest() {
|
||||||
try {
|
try {
|
||||||
@ -111,7 +134,9 @@ public class ServletUtils extends JakartaServletUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取response
|
* 获取当前 HTTP 响应对象
|
||||||
|
*
|
||||||
|
* @return 当前 HTTP 响应对象
|
||||||
*/
|
*/
|
||||||
public static HttpServletResponse getResponse() {
|
public static HttpServletResponse getResponse() {
|
||||||
try {
|
try {
|
||||||
@ -122,12 +147,25 @@ public class ServletUtils extends JakartaServletUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取session
|
* 获取当前请求的 HttpSession 对象
|
||||||
|
* <p>
|
||||||
|
* 如果当前请求已经关联了一个会话(即已经存在有效的 session ID),
|
||||||
|
* 则返回该会话对象;如果没有关联会话,则会创建一个新的会话对象并返回。
|
||||||
|
* <p>
|
||||||
|
* HttpSession 用于存储会话级别的数据,如用户登录信息、购物车内容等,
|
||||||
|
* 可以在多个请求之间共享会话数据
|
||||||
|
*
|
||||||
|
* @return 当前请求的 HttpSession 对象
|
||||||
*/
|
*/
|
||||||
public static HttpSession getSession() {
|
public static HttpSession getSession() {
|
||||||
return getRequest().getSession();
|
return getRequest().getSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前请求的请求属性
|
||||||
|
*
|
||||||
|
* @return {@link ServletRequestAttributes} 请求属性对象
|
||||||
|
*/
|
||||||
public static ServletRequestAttributes getRequestAttributes() {
|
public static ServletRequestAttributes getRequestAttributes() {
|
||||||
try {
|
try {
|
||||||
RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
|
RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
|
||||||
@ -137,6 +175,13 @@ public class ServletUtils extends JakartaServletUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取指定请求头的值,如果头部为空则返回空字符串
|
||||||
|
*
|
||||||
|
* @param request 请求对象
|
||||||
|
* @param name 头部名称
|
||||||
|
* @return 头部值
|
||||||
|
*/
|
||||||
public static String getHeader(HttpServletRequest request, String name) {
|
public static String getHeader(HttpServletRequest request, String name) {
|
||||||
String value = request.getHeader(name);
|
String value = request.getHeader(name);
|
||||||
if (StringUtils.isEmpty(value)) {
|
if (StringUtils.isEmpty(value)) {
|
||||||
@ -145,6 +190,12 @@ public class ServletUtils extends JakartaServletUtil {
|
|||||||
return urlDecode(value);
|
return urlDecode(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有请求头的 Map,键为头部名称,值为头部值
|
||||||
|
*
|
||||||
|
* @param request 请求对象
|
||||||
|
* @return 请求头的 Map
|
||||||
|
*/
|
||||||
public static Map<String, String> getHeaders(HttpServletRequest request) {
|
public static Map<String, String> getHeaders(HttpServletRequest request) {
|
||||||
Map<String, String> map = new LinkedCaseInsensitiveMap<>();
|
Map<String, String> map = new LinkedCaseInsensitiveMap<>();
|
||||||
Enumeration<String> enumeration = request.getHeaderNames();
|
Enumeration<String> enumeration = request.getHeaderNames();
|
||||||
@ -159,7 +210,7 @@ public class ServletUtils extends JakartaServletUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将字符串渲染到客户端
|
* 将字符串渲染到客户端(以 JSON 格式返回)
|
||||||
*
|
*
|
||||||
* @param response 渲染对象
|
* @param response 渲染对象
|
||||||
* @param string 待渲染的字符串
|
* @param string 待渲染的字符串
|
||||||
@ -176,37 +227,47 @@ public class ServletUtils extends JakartaServletUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否是Ajax异步请求
|
* 判断当前请求是否为 Ajax 异步请求
|
||||||
*
|
*
|
||||||
* @param request
|
* @param request 请求对象
|
||||||
|
* @return 是否为 Ajax 请求
|
||||||
*/
|
*/
|
||||||
public static boolean isAjaxRequest(HttpServletRequest request) {
|
public static boolean isAjaxRequest(HttpServletRequest request) {
|
||||||
|
|
||||||
|
// 判断 Accept 头部是否包含 application/json
|
||||||
String accept = request.getHeader("accept");
|
String accept = request.getHeader("accept");
|
||||||
if (accept != null && accept.contains(MediaType.APPLICATION_JSON_VALUE)) {
|
if (accept != null && accept.contains(MediaType.APPLICATION_JSON_VALUE)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 判断 X-Requested-With 头部是否包含 XMLHttpRequest
|
||||||
String xRequestedWith = request.getHeader("X-Requested-With");
|
String xRequestedWith = request.getHeader("X-Requested-With");
|
||||||
if (xRequestedWith != null && xRequestedWith.contains("XMLHttpRequest")) {
|
if (xRequestedWith != null && xRequestedWith.contains("XMLHttpRequest")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 判断 URI 后缀是否为 .json 或 .xml
|
||||||
String uri = request.getRequestURI();
|
String uri = request.getRequestURI();
|
||||||
if (StringUtils.equalsAnyIgnoreCase(uri, ".json", ".xml")) {
|
if (StringUtils.equalsAnyIgnoreCase(uri, ".json", ".xml")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 判断请求参数 __ajax 是否为 json 或 xml
|
||||||
String ajax = request.getParameter("__ajax");
|
String ajax = request.getParameter("__ajax");
|
||||||
return StringUtils.equalsAnyIgnoreCase(ajax, "json", "xml");
|
return StringUtils.equalsAnyIgnoreCase(ajax, "json", "xml");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取客户端 IP 地址
|
||||||
|
*
|
||||||
|
* @return 客户端 IP 地址
|
||||||
|
*/
|
||||||
public static String getClientIP() {
|
public static String getClientIP() {
|
||||||
return getClientIP(getRequest());
|
return getClientIP(getRequest());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 内容编码
|
* 对内容进行 URL 编码
|
||||||
*
|
*
|
||||||
* @param str 内容
|
* @param str 内容
|
||||||
* @return 编码后的内容
|
* @return 编码后的内容
|
||||||
@ -216,7 +277,7 @@ public class ServletUtils extends JakartaServletUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 内容解码
|
* 对内容进行 URL 解码
|
||||||
*
|
*
|
||||||
* @param str 内容
|
* @param str 内容
|
||||||
* @return 解码后的内容
|
* @return 解码后的内容
|
||||||
|
|||||||
@ -19,10 +19,12 @@ import java.util.Map;
|
|||||||
* @author 老马
|
* @author 老马
|
||||||
*/
|
*/
|
||||||
public class EncryptUtils {
|
public class EncryptUtils {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公钥
|
* 公钥
|
||||||
*/
|
*/
|
||||||
public static final String PUBLIC_KEY = "publicKey";
|
public static final String PUBLIC_KEY = "publicKey";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 私钥
|
* 私钥
|
||||||
*/
|
*/
|
||||||
@ -51,7 +53,7 @@ public class EncryptUtils {
|
|||||||
/**
|
/**
|
||||||
* AES加密
|
* AES加密
|
||||||
*
|
*
|
||||||
* @param data 待解密数据
|
* @param data 待加密数据
|
||||||
* @param password 秘钥字符串
|
* @param password 秘钥字符串
|
||||||
* @return 加密后字符串, 采用Base64编码
|
* @return 加密后字符串, 采用Base64编码
|
||||||
*/
|
*/
|
||||||
@ -70,7 +72,7 @@ public class EncryptUtils {
|
|||||||
/**
|
/**
|
||||||
* AES加密
|
* AES加密
|
||||||
*
|
*
|
||||||
* @param data 待解密数据
|
* @param data 待加密数据
|
||||||
* @param password 秘钥字符串
|
* @param password 秘钥字符串
|
||||||
* @return 加密后字符串, 采用Hex编码
|
* @return 加密后字符串, 采用Hex编码
|
||||||
*/
|
*/
|
||||||
@ -208,7 +210,7 @@ public class EncryptUtils {
|
|||||||
/**
|
/**
|
||||||
* sm2私钥解密
|
* sm2私钥解密
|
||||||
*
|
*
|
||||||
* @param data 待加密数据
|
* @param data 待解密数据
|
||||||
* @param privateKey 私钥
|
* @param privateKey 私钥
|
||||||
* @return 解密后字符串
|
* @return 解密后字符串
|
||||||
*/
|
*/
|
||||||
@ -266,7 +268,7 @@ public class EncryptUtils {
|
|||||||
/**
|
/**
|
||||||
* rsa私钥解密
|
* rsa私钥解密
|
||||||
*
|
*
|
||||||
* @param data 待加密数据
|
* @param data 待解密数据
|
||||||
* @param privateKey 私钥
|
* @param privateKey 私钥
|
||||||
* @return 解密后字符串
|
* @return 解密后字符串
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -100,7 +100,7 @@ public class LogAspect {
|
|||||||
|
|
||||||
if (e != null) {
|
if (e != null) {
|
||||||
operLog.setStatus(BusinessStatus.FAIL.ordinal());
|
operLog.setStatus(BusinessStatus.FAIL.ordinal());
|
||||||
operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000));
|
operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 3800));
|
||||||
}
|
}
|
||||||
// 设置方法名称
|
// 设置方法名称
|
||||||
String className = joinPoint.getTarget().getClass().getName();
|
String className = joinPoint.getTarget().getClass().getName();
|
||||||
@ -146,7 +146,7 @@ public class LogAspect {
|
|||||||
}
|
}
|
||||||
// 是否需要保存response,参数和值
|
// 是否需要保存response,参数和值
|
||||||
if (log.isSaveResponseData() && ObjectUtil.isNotNull(jsonResult)) {
|
if (log.isSaveResponseData() && ObjectUtil.isNotNull(jsonResult)) {
|
||||||
operLog.setJsonResult(StringUtils.substring(JsonUtils.toJsonString(jsonResult), 0, 2000));
|
operLog.setJsonResult(StringUtils.substring(JsonUtils.toJsonString(jsonResult), 0, 3800));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,11 +161,11 @@ public class LogAspect {
|
|||||||
String requestMethod = operLog.getRequestMethod();
|
String requestMethod = operLog.getRequestMethod();
|
||||||
if (MapUtil.isEmpty(paramsMap) && StringUtils.equalsAny(requestMethod, HttpMethod.PUT.name(), HttpMethod.POST.name(), HttpMethod.DELETE.name())) {
|
if (MapUtil.isEmpty(paramsMap) && StringUtils.equalsAny(requestMethod, HttpMethod.PUT.name(), HttpMethod.POST.name(), HttpMethod.DELETE.name())) {
|
||||||
String params = argsArrayToString(joinPoint.getArgs(), excludeParamNames);
|
String params = argsArrayToString(joinPoint.getArgs(), excludeParamNames);
|
||||||
operLog.setOperParam(StringUtils.substring(params, 0, 2000));
|
operLog.setOperParam(StringUtils.substring(params, 0, 3800));
|
||||||
} else {
|
} else {
|
||||||
MapUtil.removeAny(paramsMap, EXCLUDE_PROPERTIES);
|
MapUtil.removeAny(paramsMap, EXCLUDE_PROPERTIES);
|
||||||
MapUtil.removeAny(paramsMap, excludeParamNames);
|
MapUtil.removeAny(paramsMap, excludeParamNames);
|
||||||
operLog.setOperParam(StringUtils.substring(JsonUtils.toJsonString(paramsMap), 0, 2000));
|
operLog.setOperParam(StringUtils.substring(JsonUtils.toJsonString(paramsMap), 0, 3800));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -52,7 +52,7 @@ public class MybatisPlusConfig {
|
|||||||
* 数据权限拦截器
|
* 数据权限拦截器
|
||||||
*/
|
*/
|
||||||
public PlusDataPermissionInterceptor dataPermissionInterceptor() {
|
public PlusDataPermissionInterceptor dataPermissionInterceptor() {
|
||||||
return new PlusDataPermissionInterceptor();
|
return new PlusDataPermissionInterceptor(SpringUtils.getProperty("mybatis-plus.mapperPackage"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -48,7 +48,12 @@ public enum DataScopeType {
|
|||||||
/**
|
/**
|
||||||
* 仅本人数据权限
|
* 仅本人数据权限
|
||||||
*/
|
*/
|
||||||
SELF("5", " #{#userName} = #{#user.userId} ", " 1 = 0 ");
|
SELF("5", " #{#userName} = #{#user.userId} ", " 1 = 0 "),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门及以下或本人数据权限
|
||||||
|
*/
|
||||||
|
DEPT_AND_CHILD_OR_SELF("6", " #{#deptName} IN ( #{@sdss.getDeptAndChild( #user.deptId )} ) OR #{#userName} = #{#user.userId} ", " 1 = 0 ");
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package org.dromara.common.mybatis.handler;
|
package org.dromara.common.mybatis.handler;
|
||||||
|
|
||||||
|
import cn.hutool.core.annotation.AnnotationUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -8,6 +9,7 @@ import net.sf.jsqlparser.expression.Expression;
|
|||||||
import net.sf.jsqlparser.expression.operators.conditional.AndExpression;
|
import net.sf.jsqlparser.expression.operators.conditional.AndExpression;
|
||||||
import net.sf.jsqlparser.expression.operators.relational.ParenthesedExpressionList;
|
import net.sf.jsqlparser.expression.operators.relational.ParenthesedExpressionList;
|
||||||
import net.sf.jsqlparser.parser.CCJSqlParserUtil;
|
import net.sf.jsqlparser.parser.CCJSqlParserUtil;
|
||||||
|
import org.apache.ibatis.io.Resources;
|
||||||
import org.dromara.common.core.domain.dto.RoleDTO;
|
import org.dromara.common.core.domain.dto.RoleDTO;
|
||||||
import org.dromara.common.core.domain.model.LoginUser;
|
import org.dromara.common.core.domain.model.LoginUser;
|
||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
@ -19,17 +21,23 @@ import org.dromara.common.mybatis.annotation.DataPermission;
|
|||||||
import org.dromara.common.mybatis.enums.DataScopeType;
|
import org.dromara.common.mybatis.enums.DataScopeType;
|
||||||
import org.dromara.common.mybatis.helper.DataPermissionHelper;
|
import org.dromara.common.mybatis.helper.DataPermissionHelper;
|
||||||
import org.dromara.common.satoken.utils.LoginHelper;
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
|
import org.springframework.context.ConfigurableApplicationContext;
|
||||||
import org.springframework.context.expression.BeanFactoryResolver;
|
import org.springframework.context.expression.BeanFactoryResolver;
|
||||||
|
import org.springframework.core.io.Resource;
|
||||||
|
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||||
|
import org.springframework.core.io.support.ResourcePatternResolver;
|
||||||
|
import org.springframework.core.type.ClassMetadata;
|
||||||
|
import org.springframework.core.type.classreading.CachingMetadataReaderFactory;
|
||||||
import org.springframework.expression.BeanResolver;
|
import org.springframework.expression.BeanResolver;
|
||||||
import org.springframework.expression.ExpressionParser;
|
import org.springframework.expression.ExpressionParser;
|
||||||
import org.springframework.expression.ParserContext;
|
import org.springframework.expression.ParserContext;
|
||||||
import org.springframework.expression.common.TemplateParserContext;
|
import org.springframework.expression.common.TemplateParserContext;
|
||||||
import org.springframework.expression.spel.standard.SpelExpressionParser;
|
import org.springframework.expression.spel.standard.SpelExpressionParser;
|
||||||
import org.springframework.expression.spel.support.StandardEvaluationContext;
|
import org.springframework.expression.spel.support.StandardEvaluationContext;
|
||||||
|
import org.springframework.util.ClassUtils;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.*;
|
||||||
import java.util.HashSet;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -41,6 +49,11 @@ import java.util.function.Function;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class PlusDataPermissionHandler {
|
public class PlusDataPermissionHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类名称与注解的映射关系缓存(由于aop无法拦截mybatis接口类上的注解 只能通过启动预扫描的方式进行)
|
||||||
|
*/
|
||||||
|
private final Map<String, DataPermission> dataPermissionCacheMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* spel 解析器
|
* spel 解析器
|
||||||
*/
|
*/
|
||||||
@ -51,6 +64,15 @@ public class PlusDataPermissionHandler {
|
|||||||
*/
|
*/
|
||||||
private final BeanResolver beanResolver = new BeanFactoryResolver(SpringUtils.getBeanFactory());
|
private final BeanResolver beanResolver = new BeanFactoryResolver(SpringUtils.getBeanFactory());
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构造方法,扫描指定包下的 Mapper 类并初始化缓存
|
||||||
|
*
|
||||||
|
* @param mapperPackage Mapper 类所在的包路径
|
||||||
|
*/
|
||||||
|
public PlusDataPermissionHandler(String mapperPackage) {
|
||||||
|
scanMapperClasses(mapperPackage);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取数据过滤条件的 SQL 片段
|
* 获取数据过滤条件的 SQL 片段
|
||||||
*
|
*
|
||||||
@ -62,7 +84,7 @@ public class PlusDataPermissionHandler {
|
|||||||
public Expression getSqlSegment(Expression where, String mappedStatementId, boolean isSelect) {
|
public Expression getSqlSegment(Expression where, String mappedStatementId, boolean isSelect) {
|
||||||
try {
|
try {
|
||||||
// 获取数据权限配置
|
// 获取数据权限配置
|
||||||
DataPermission dataPermission = DataPermissionHelper.getPermission();
|
DataPermission dataPermission = getDataPermission(mappedStatementId);
|
||||||
// 获取当前登录用户信息
|
// 获取当前登录用户信息
|
||||||
LoginUser currentUser = DataPermissionHelper.getVariable("user");
|
LoginUser currentUser = DataPermissionHelper.getVariable("user");
|
||||||
if (ObjectUtil.isNull(currentUser)) {
|
if (ObjectUtil.isNull(currentUser)) {
|
||||||
@ -124,27 +146,31 @@ public class PlusDataPermissionHandler {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
boolean isSuccess = false;
|
boolean isSuccess = false;
|
||||||
|
List<String> keys = new ArrayList<>();
|
||||||
for (DataColumn dataColumn : dataPermission.value()) {
|
for (DataColumn dataColumn : dataPermission.value()) {
|
||||||
if (dataColumn.key().length != dataColumn.value().length) {
|
if (dataColumn.key().length != dataColumn.value().length) {
|
||||||
throw new ServiceException("角色数据范围异常 => key与value长度不匹配");
|
throw new ServiceException("角色数据范围异常 => key与value长度不匹配");
|
||||||
}
|
}
|
||||||
|
// 设置注解变量 key 为表达式变量 value 为变量值
|
||||||
|
for (int i = 0; i < dataColumn.key().length; i++) {
|
||||||
|
context.setVariable(dataColumn.key()[i], dataColumn.value()[i]);
|
||||||
|
}
|
||||||
|
keys.addAll(Arrays.stream(dataColumn.key()).map(key -> "#" + key).toList());
|
||||||
|
}
|
||||||
|
for (DataColumn dataColumn : dataPermission.value()) {
|
||||||
// 不包含 key 变量 则不处理
|
// 不包含 key 变量 则不处理
|
||||||
if (!StringUtils.containsAny(type.getSqlTemplate(),
|
if (!StringUtils.containsAny(type.getSqlTemplate(), keys.toArray(String[]::new))) {
|
||||||
Arrays.stream(dataColumn.key()).map(key -> "#" + key).toArray(String[]::new)
|
|
||||||
)) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 包含权限标识符 这直接跳过
|
// 包含权限标识符 这直接跳过
|
||||||
if (StringUtils.isNotBlank(dataColumn.permission()) &&
|
if (StringUtils.isNotBlank(dataColumn.permission()) &&
|
||||||
CollUtil.contains(user.getMenuPermission(), dataColumn.permission())
|
CollUtil.contains(user.getMenuPermission(), dataColumn.permission())
|
||||||
) {
|
) {
|
||||||
|
// 修复多角色与权限标识符共用问题 https://gitee.com/dromara/RuoYi-Vue-Plus/issues/IB4CS4
|
||||||
|
conditions.add(joinStr + " 1 = 1 ");
|
||||||
isSuccess = true;
|
isSuccess = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 设置注解变量 key 为表达式变量 value 为变量值
|
|
||||||
for (int i = 0; i < dataColumn.key().length; i++) {
|
|
||||||
context.setVariable(dataColumn.key()[i], dataColumn.value()[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 忽略数据权限 防止spel表达式内有其他sql查询导致死循环调用
|
// 忽略数据权限 防止spel表达式内有其他sql查询导致死循环调用
|
||||||
String sql = DataPermissionHelper.ignore(() ->
|
String sql = DataPermissionHelper.ignore(() ->
|
||||||
@ -167,12 +193,68 @@ public class PlusDataPermissionHandler {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫描指定包下的 Mapper 类,并查找其中带有特定注解的方法或类
|
||||||
|
*
|
||||||
|
* @param mapperPackage Mapper 类所在的包路径
|
||||||
|
*/
|
||||||
|
private void scanMapperClasses(String mapperPackage) {
|
||||||
|
// 创建资源解析器和元数据读取工厂
|
||||||
|
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
|
||||||
|
CachingMetadataReaderFactory factory = new CachingMetadataReaderFactory();
|
||||||
|
// 将 Mapper 包路径按分隔符拆分为数组
|
||||||
|
String[] packagePatternArray = StringUtils.splitPreserveAllTokens(mapperPackage, ConfigurableApplicationContext.CONFIG_LOCATION_DELIMITERS);
|
||||||
|
String classpath = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX;
|
||||||
|
try {
|
||||||
|
for (String packagePattern : packagePatternArray) {
|
||||||
|
// 将包路径转换为资源路径
|
||||||
|
String path = ClassUtils.convertClassNameToResourcePath(packagePattern);
|
||||||
|
// 获取指定路径下的所有 .class 文件资源
|
||||||
|
Resource[] resources = resolver.getResources(classpath + path + "/*.class");
|
||||||
|
for (Resource resource : resources) {
|
||||||
|
// 获取资源的类元数据
|
||||||
|
ClassMetadata classMetadata = factory.getMetadataReader(resource).getClassMetadata();
|
||||||
|
// 获取资源对应的类对象
|
||||||
|
Class<?> clazz = Resources.classForName(classMetadata.getClassName());
|
||||||
|
// 查找类中的特定注解
|
||||||
|
if (AnnotationUtil.hasAnnotation(clazz, DataPermission.class)) {
|
||||||
|
DataPermission dataPermission = AnnotationUtil.getAnnotation(clazz, DataPermission.class);
|
||||||
|
dataPermissionCacheMap.put(clazz.getName(), dataPermission);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("初始化数据安全缓存时出错:{}", e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据映射语句 ID 或类名获取对应的 DataPermission 注解对象
|
||||||
|
*
|
||||||
|
* @param mapperId 映射语句 ID
|
||||||
|
* @return DataPermission 注解对象,如果不存在则返回 null
|
||||||
|
*/
|
||||||
|
public DataPermission getDataPermission(String mapperId) {
|
||||||
|
// 检查上下文中是否包含映射语句 ID 对应的 DataPermission 注解对象
|
||||||
|
if (DataPermissionHelper.getPermission() != null) {
|
||||||
|
return DataPermissionHelper.getPermission();
|
||||||
|
}
|
||||||
|
// 如果缓存中不包含映射语句 ID 对应的 DataPermission 注解对象,则尝试使用类名作为键查找
|
||||||
|
String clazzName = mapperId.substring(0, mapperId.lastIndexOf("."));
|
||||||
|
if (dataPermissionCacheMap.containsKey(clazzName)) {
|
||||||
|
return dataPermissionCacheMap.get(clazzName);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查给定的映射语句 ID 是否有效,即是否能够找到对应的 DataPermission 注解对象
|
* 检查给定的映射语句 ID 是否有效,即是否能够找到对应的 DataPermission 注解对象
|
||||||
*
|
*
|
||||||
|
* @param mapperId 映射语句 ID
|
||||||
* @return 如果找到对应的 DataPermission 注解对象,则返回 false;否则返回 true
|
* @return 如果找到对应的 DataPermission 注解对象,则返回 false;否则返回 true
|
||||||
*/
|
*/
|
||||||
public boolean invalid() {
|
public boolean invalid(String mapperId) {
|
||||||
return DataPermissionHelper.getPermission() == null;
|
return getDataPermission(mapperId) == null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,9 +39,11 @@ public class PlusDataPermissionInterceptor extends BaseMultiTableInnerIntercepto
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 构造函数,初始化 PlusDataPermissionHandler 实例
|
* 构造函数,初始化 PlusDataPermissionHandler 实例
|
||||||
|
*
|
||||||
|
* @param mapperPackage 扫描的映射器包
|
||||||
*/
|
*/
|
||||||
public PlusDataPermissionInterceptor() {
|
public PlusDataPermissionInterceptor(String mapperPackage) {
|
||||||
this.dataPermissionHandler = new PlusDataPermissionHandler();
|
this.dataPermissionHandler = new PlusDataPermissionHandler(mapperPackage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,7 +64,7 @@ public class PlusDataPermissionInterceptor extends BaseMultiTableInnerIntercepto
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 检查是否缺少有效的数据权限注解
|
// 检查是否缺少有效的数据权限注解
|
||||||
if (dataPermissionHandler.invalid()) {
|
if (dataPermissionHandler.invalid(ms.getId())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 解析 sql 分配对应方法
|
// 解析 sql 分配对应方法
|
||||||
@ -90,7 +92,7 @@ public class PlusDataPermissionInterceptor extends BaseMultiTableInnerIntercepto
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 检查是否缺少有效的数据权限注解
|
// 检查是否缺少有效的数据权限注解
|
||||||
if (dataPermissionHandler.invalid()) {
|
if (dataPermissionHandler.invalid(ms.getId())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PluginUtils.MPBoundSql mpBs = mpSh.mPBoundSql();
|
PluginUtils.MPBoundSql mpBs = mpSh.mPBoundSql();
|
||||||
|
|||||||
@ -42,6 +42,18 @@
|
|||||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- <!– redis序列化替代方案 比json快无数的跨语言二进制序列化 –>-->
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>org.apache.fury</groupId>-->
|
||||||
|
<!-- <artifactId>fury-core</artifactId>-->
|
||||||
|
<!-- <version>0.9.0</version>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>org.slf4j</groupId>-->
|
||||||
|
<!-- <artifactId>slf4j-api</artifactId>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@ -53,6 +53,9 @@ public class RedisConfig {
|
|||||||
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
|
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
|
||||||
// 指定序列化输入的类型,类必须是非final修饰的。序列化时将对象全类名一起保存下来
|
// 指定序列化输入的类型,类必须是非final修饰的。序列化时将对象全类名一起保存下来
|
||||||
om.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL);
|
om.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL);
|
||||||
|
// LoggerFactory.useSlf4jLogging(true);
|
||||||
|
// FuryCodec furyCodec = new FuryCodec();
|
||||||
|
// CompositeCodec codec = new CompositeCodec(StringCodec.INSTANCE, furyCodec, furyCodec);
|
||||||
TypedJsonJacksonCodec jsonCodec = new TypedJsonJacksonCodec(Object.class, om);
|
TypedJsonJacksonCodec jsonCodec = new TypedJsonJacksonCodec(Object.class, om);
|
||||||
// 组合序列化 key 使用 String 内容使用通用 json 格式
|
// 组合序列化 key 使用 String 内容使用通用 json 格式
|
||||||
CompositeCodec codec = new CompositeCodec(StringCodec.INSTANCE, jsonCodec, jsonCodec);
|
CompositeCodec codec = new CompositeCodec(StringCodec.INSTANCE, jsonCodec, jsonCodec);
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
package org.dromara.common.web.config;
|
package org.dromara.common.web.config;
|
||||||
|
|
||||||
import io.undertow.server.DefaultByteBufferPool;
|
import io.undertow.server.DefaultByteBufferPool;
|
||||||
|
import io.undertow.server.handlers.DisallowedMethodsHandler;
|
||||||
|
import io.undertow.util.HttpString;
|
||||||
import io.undertow.websockets.jsr.WebSocketDeploymentInfo;
|
import io.undertow.websockets.jsr.WebSocketDeploymentInfo;
|
||||||
import org.dromara.common.core.utils.SpringUtils;
|
import org.dromara.common.core.utils.SpringUtils;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
@ -16,18 +18,45 @@ import org.springframework.core.task.VirtualThreadTaskExecutor;
|
|||||||
@AutoConfiguration
|
@AutoConfiguration
|
||||||
public class UndertowConfig implements WebServerFactoryCustomizer<UndertowServletWebServerFactory> {
|
public class UndertowConfig implements WebServerFactoryCustomizer<UndertowServletWebServerFactory> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义 Undertow 配置
|
||||||
|
* <p>
|
||||||
|
* 主要配置内容包括:
|
||||||
|
* 1. 配置 WebSocket 部署信息
|
||||||
|
* 2. 在虚拟线程模式下使用虚拟线程池
|
||||||
|
* 3. 禁用不安全的 HTTP 方法,如 CONNECT、TRACE、TRACK
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param factory Undertow 的 Web 服务器工厂
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void customize(UndertowServletWebServerFactory factory) {
|
public void customize(UndertowServletWebServerFactory factory) {
|
||||||
factory.addDeploymentInfoCustomizers(deploymentInfo -> {
|
factory.addDeploymentInfoCustomizers(deploymentInfo -> {
|
||||||
|
// 配置 WebSocket 部署信息,设置 WebSocket 使用的缓冲区池
|
||||||
WebSocketDeploymentInfo webSocketDeploymentInfo = new WebSocketDeploymentInfo();
|
WebSocketDeploymentInfo webSocketDeploymentInfo = new WebSocketDeploymentInfo();
|
||||||
webSocketDeploymentInfo.setBuffers(new DefaultByteBufferPool(true, 1024));
|
webSocketDeploymentInfo.setBuffers(new DefaultByteBufferPool(true, 1024));
|
||||||
deploymentInfo.addServletContextAttribute("io.undertow.websockets.jsr.WebSocketDeploymentInfo", webSocketDeploymentInfo);
|
deploymentInfo.addServletContextAttribute("io.undertow.websockets.jsr.WebSocketDeploymentInfo", webSocketDeploymentInfo);
|
||||||
// 使用虚拟线程
|
|
||||||
|
// 如果启用了虚拟线程,配置 Undertow 使用虚拟线程池
|
||||||
if (SpringUtils.isVirtual()) {
|
if (SpringUtils.isVirtual()) {
|
||||||
|
// 创建虚拟线程池,线程池前缀为 "undertow-"
|
||||||
VirtualThreadTaskExecutor executor = new VirtualThreadTaskExecutor("undertow-");
|
VirtualThreadTaskExecutor executor = new VirtualThreadTaskExecutor("undertow-");
|
||||||
|
// 设置虚拟线程池为执行器和异步执行器
|
||||||
deploymentInfo.setExecutor(executor);
|
deploymentInfo.setExecutor(executor);
|
||||||
deploymentInfo.setAsyncExecutor(executor);
|
deploymentInfo.setAsyncExecutor(executor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 配置禁止某些不安全的 HTTP 方法(如 CONNECT、TRACE、TRACK)
|
||||||
|
deploymentInfo.addInitialHandlerChainWrapper(handler -> {
|
||||||
|
// 禁止三个方法 CONNECT/TRACE/TRACK 也是不安全的 避免爬虫骚扰
|
||||||
|
HttpString[] disallowedHttpMethods = {
|
||||||
|
HttpString.tryFromString("CONNECT"),
|
||||||
|
HttpString.tryFromString("TRACE"),
|
||||||
|
HttpString.tryFromString("TRACK")
|
||||||
|
};
|
||||||
|
// 使用 DisallowedMethodsHandler 拦截并拒绝这些方法的请求
|
||||||
|
return new DisallowedMethodsHandler(handler, disallowedHttpMethods);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# 贝尔实验室 Spring 官方推荐镜像 JDK下载地址 https://bell-sw.com/pages/downloads/
|
# 贝尔实验室 Spring 官方推荐镜像 JDK下载地址 https://bell-sw.com/pages/downloads/
|
||||||
FROM bellsoft/liberica-openjdk-debian:17.0.11-cds
|
FROM bellsoft/liberica-openjdk-debian:17.0.11-cds
|
||||||
#FROM bellsoft/liberica-openjdk-debian:21.0.3-cds
|
#FROM bellsoft/liberica-openjdk-debian:21.0.5-cds
|
||||||
#FROM findepi/graalvm:java17-native
|
#FROM findepi/graalvm:java17-native
|
||||||
|
|
||||||
LABEL maintainer="Lion Li"
|
LABEL maintainer="Lion Li"
|
||||||
@ -15,6 +15,8 @@ EXPOSE 9090
|
|||||||
|
|
||||||
ADD ./target/ruoyi-monitor-admin.jar ./app.jar
|
ADD ./target/ruoyi-monitor-admin.jar ./app.jar
|
||||||
|
|
||||||
|
SHELL ["/bin/bash", "-c"]
|
||||||
|
|
||||||
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \
|
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \
|
||||||
-XX:+HeapDumpOnOutOfMemoryError -XX:+UseZGC ${JAVA_OPTS} \
|
-XX:+HeapDumpOnOutOfMemoryError -XX:+UseZGC ${JAVA_OPTS} \
|
||||||
-jar app.jar
|
-jar app.jar
|
||||||
|
|||||||
@ -19,7 +19,6 @@ spring:
|
|||||||
admin:
|
admin:
|
||||||
ui:
|
ui:
|
||||||
title: RuoYi-Vue-Plus服务监控中心
|
title: RuoYi-Vue-Plus服务监控中心
|
||||||
context-path: /admin
|
|
||||||
|
|
||||||
--- # Actuator 监控端点的配置项
|
--- # Actuator 监控端点的配置项
|
||||||
management:
|
management:
|
||||||
@ -38,7 +37,7 @@ spring.boot.admin.client:
|
|||||||
# 增加客户端开关
|
# 增加客户端开关
|
||||||
enabled: true
|
enabled: true
|
||||||
# 设置 Spring Boot Admin Server 地址
|
# 设置 Spring Boot Admin Server 地址
|
||||||
url: http://localhost:9090/admin
|
url: http://localhost:9090
|
||||||
instance:
|
instance:
|
||||||
service-host-type: IP
|
service-host-type: IP
|
||||||
metadata:
|
metadata:
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# 贝尔实验室 Spring 官方推荐镜像 JDK下载地址 https://bell-sw.com/pages/downloads/
|
# 贝尔实验室 Spring 官方推荐镜像 JDK下载地址 https://bell-sw.com/pages/downloads/
|
||||||
FROM bellsoft/liberica-openjdk-debian:17.0.11-cds
|
FROM bellsoft/liberica-openjdk-debian:17.0.11-cds
|
||||||
#FROM bellsoft/liberica-openjdk-debian:21.0.3-cds
|
#FROM bellsoft/liberica-openjdk-debian:21.0.5-cds
|
||||||
#FROM findepi/graalvm:java17-native
|
#FROM findepi/graalvm:java17-native
|
||||||
|
|
||||||
LABEL maintainer="Lion Li"
|
LABEL maintainer="Lion Li"
|
||||||
@ -16,6 +16,8 @@ EXPOSE 17888
|
|||||||
|
|
||||||
ADD ./target/ruoyi-snailjob-server.jar ./app.jar
|
ADD ./target/ruoyi-snailjob-server.jar ./app.jar
|
||||||
|
|
||||||
|
SHELL ["/bin/bash", "-c"]
|
||||||
|
|
||||||
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \
|
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \
|
||||||
-XX:+HeapDumpOnOutOfMemoryError -XX:+UseZGC ${JAVA_OPTS} \
|
-XX:+HeapDumpOnOutOfMemoryError -XX:+UseZGC ${JAVA_OPTS} \
|
||||||
-jar app.jar
|
-jar app.jar
|
||||||
|
|||||||
@ -22,7 +22,7 @@ public class SecurityConfig {
|
|||||||
public FilterRegistrationBean<ActuatorAuthFilter> actuatorFilterRegistrationBean() {
|
public FilterRegistrationBean<ActuatorAuthFilter> actuatorFilterRegistrationBean() {
|
||||||
FilterRegistrationBean<ActuatorAuthFilter> registrationBean = new FilterRegistrationBean<>();
|
FilterRegistrationBean<ActuatorAuthFilter> registrationBean = new FilterRegistrationBean<>();
|
||||||
registrationBean.setFilter(new ActuatorAuthFilter(username, password));
|
registrationBean.setFilter(new ActuatorAuthFilter(username, password));
|
||||||
registrationBean.addUrlPatterns("/actuator", "/actuator/**");
|
registrationBean.addUrlPatterns("/actuator", "/actuator/*");
|
||||||
return registrationBean;
|
return registrationBean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -40,7 +40,7 @@ snail-job:
|
|||||||
spring.boot.admin.client:
|
spring.boot.admin.client:
|
||||||
# 增加客户端开关
|
# 增加客户端开关
|
||||||
enabled: true
|
enabled: true
|
||||||
url: http://localhost:9090/admin
|
url: http://localhost:9090
|
||||||
instance:
|
instance:
|
||||||
service-host-type: IP
|
service-host-type: IP
|
||||||
metadata:
|
metadata:
|
||||||
|
|||||||
@ -40,7 +40,7 @@ snail-job:
|
|||||||
spring.boot.admin.client:
|
spring.boot.admin.client:
|
||||||
# 增加客户端开关
|
# 增加客户端开关
|
||||||
enabled: true
|
enabled: true
|
||||||
url: http://localhost:9090/admin
|
url: http://localhost:9090
|
||||||
instance:
|
instance:
|
||||||
service-host-type: IP
|
service-host-type: IP
|
||||||
metadata:
|
metadata:
|
||||||
|
|||||||
@ -303,14 +303,18 @@ public class GenTableServiceImpl implements IGenTableService {
|
|||||||
@DS("#dataName")
|
@DS("#dataName")
|
||||||
@Override
|
@Override
|
||||||
public List<GenTableColumn> selectDbTableColumnsByName(String tableName, String dataName) {
|
public List<GenTableColumn> selectDbTableColumnsByName(String tableName, String dataName) {
|
||||||
LinkedHashMap<String, Column> columns = ServiceProxy.metadata().columns(tableName);
|
Table<?> table = ServiceProxy.metadata().table(tableName);
|
||||||
|
if (ObjectUtil.isNull(table)) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
LinkedHashMap<String, Column> columns = table.getColumns();
|
||||||
List<GenTableColumn> tableColumns = new ArrayList<>();
|
List<GenTableColumn> tableColumns = new ArrayList<>();
|
||||||
columns.forEach((columnName, column) -> {
|
columns.forEach((columnName, column) -> {
|
||||||
GenTableColumn tableColumn = new GenTableColumn();
|
GenTableColumn tableColumn = new GenTableColumn();
|
||||||
tableColumn.setIsPk(String.valueOf(column.isPrimaryKey()));
|
tableColumn.setIsPk(String.valueOf(column.isPrimaryKey()));
|
||||||
tableColumn.setColumnName(column.getName());
|
tableColumn.setColumnName(column.getName());
|
||||||
tableColumn.setColumnComment(column.getComment());
|
tableColumn.setColumnComment(column.getComment());
|
||||||
tableColumn.setColumnType(column.getTypeName().toLowerCase());
|
tableColumn.setColumnType(column.getOriginType().toLowerCase());
|
||||||
tableColumn.setSort(column.getPosition());
|
tableColumn.setSort(column.getPosition());
|
||||||
tableColumn.setIsRequired(column.isNullable() == 0 ? "1" : "0");
|
tableColumn.setIsRequired(column.isNullable() == 0 ? "1" : "0");
|
||||||
tableColumn.setIsIncrement(column.isAutoIncrement() == -1 ? "0" : "1");
|
tableColumn.setIsIncrement(column.isAutoIncrement() == -1 ? "0" : "1");
|
||||||
|
|||||||
@ -113,7 +113,7 @@ public class SysUserOnlineController extends BaseController {
|
|||||||
* @param tokenId token值
|
* @param tokenId token值
|
||||||
*/
|
*/
|
||||||
@Log(title = "在线设备", businessType = BusinessType.FORCE)
|
@Log(title = "在线设备", businessType = BusinessType.FORCE)
|
||||||
@PostMapping("/{tokenId}")
|
@DeleteMapping("/myself/{tokenId}")
|
||||||
public R<Void> remove(@PathVariable("tokenId") String tokenId) {
|
public R<Void> remove(@PathVariable("tokenId") String tokenId) {
|
||||||
try {
|
try {
|
||||||
// 获取指定账号 id 的 token 集合
|
// 获取指定账号 id 的 token 集合
|
||||||
|
|||||||
@ -59,7 +59,7 @@ public class SysTenantController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY)
|
@SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY)
|
||||||
@SaCheckPermission("system:tenant:export")
|
@SaCheckPermission("system:tenant:export")
|
||||||
@Log(title = "租户", businessType = BusinessType.EXPORT)
|
@Log(title = "租户管理", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(SysTenantBo bo, HttpServletResponse response) {
|
public void export(SysTenantBo bo, HttpServletResponse response) {
|
||||||
List<SysTenantVo> list = tenantService.queryList(bo);
|
List<SysTenantVo> list = tenantService.queryList(bo);
|
||||||
@ -85,7 +85,7 @@ public class SysTenantController extends BaseController {
|
|||||||
@ApiEncrypt
|
@ApiEncrypt
|
||||||
@SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY)
|
@SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY)
|
||||||
@SaCheckPermission("system:tenant:add")
|
@SaCheckPermission("system:tenant:add")
|
||||||
@Log(title = "租户", businessType = BusinessType.INSERT)
|
@Log(title = "租户管理", businessType = BusinessType.INSERT)
|
||||||
@Lock4j
|
@Lock4j
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
@ -101,7 +101,7 @@ public class SysTenantController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY)
|
@SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY)
|
||||||
@SaCheckPermission("system:tenant:edit")
|
@SaCheckPermission("system:tenant:edit")
|
||||||
@Log(title = "租户", businessType = BusinessType.UPDATE)
|
@Log(title = "租户管理", businessType = BusinessType.UPDATE)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysTenantBo bo) {
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysTenantBo bo) {
|
||||||
@ -117,7 +117,7 @@ public class SysTenantController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY)
|
@SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY)
|
||||||
@SaCheckPermission("system:tenant:edit")
|
@SaCheckPermission("system:tenant:edit")
|
||||||
@Log(title = "租户", businessType = BusinessType.UPDATE)
|
@Log(title = "租户管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/changeStatus")
|
@PutMapping("/changeStatus")
|
||||||
public R<Void> changeStatus(@RequestBody SysTenantBo bo) {
|
public R<Void> changeStatus(@RequestBody SysTenantBo bo) {
|
||||||
tenantService.checkTenantAllowed(bo.getTenantId());
|
tenantService.checkTenantAllowed(bo.getTenantId());
|
||||||
@ -131,7 +131,7 @@ public class SysTenantController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY)
|
@SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY)
|
||||||
@SaCheckPermission("system:tenant:remove")
|
@SaCheckPermission("system:tenant:remove")
|
||||||
@Log(title = "租户", businessType = BusinessType.DELETE)
|
@Log(title = "租户管理", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
@PathVariable Long[] ids) {
|
@PathVariable Long[] ids) {
|
||||||
@ -169,7 +169,7 @@ public class SysTenantController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY)
|
@SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY)
|
||||||
@SaCheckPermission("system:tenant:edit")
|
@SaCheckPermission("system:tenant:edit")
|
||||||
@Log(title = "租户", businessType = BusinessType.UPDATE)
|
@Log(title = "租户管理", businessType = BusinessType.UPDATE)
|
||||||
@GetMapping("/syncTenantPackage")
|
@GetMapping("/syncTenantPackage")
|
||||||
public R<Void> syncTenantPackage(@NotBlank(message = "租户ID不能为空") String tenantId,
|
public R<Void> syncTenantPackage(@NotBlank(message = "租户ID不能为空") String tenantId,
|
||||||
@NotNull(message = "套餐ID不能为空") Long packageId) {
|
@NotNull(message = "套餐ID不能为空") Long packageId) {
|
||||||
@ -180,7 +180,7 @@ public class SysTenantController extends BaseController {
|
|||||||
* 同步租户字典
|
* 同步租户字典
|
||||||
*/
|
*/
|
||||||
@SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY)
|
@SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY)
|
||||||
@Log(title = "同步租户字典", businessType = BusinessType.INSERT)
|
@Log(title = "租户管理", businessType = BusinessType.INSERT)
|
||||||
@GetMapping("/syncTenantDict")
|
@GetMapping("/syncTenantDict")
|
||||||
public R<Void> syncTenantDict() {
|
public R<Void> syncTenantDict() {
|
||||||
if (!TenantHelper.isEnable()) {
|
if (!TenantHelper.isEnable()) {
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
version: '3'
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# 此镜像仅用于测试 正式环境需自行安装数据库
|
# 此镜像仅用于测试 正式环境需自行安装数据库
|
||||||
# SID: XE user: system password: oracle
|
# SID: XE user: system password: oracle
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
version: '3'
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mysql:
|
mysql:
|
||||||
image: mysql:8.0.33
|
image: mysql:8.0.33
|
||||||
|
|||||||
@ -96,7 +96,7 @@ http {
|
|||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header REMOTE-HOST $remote_addr;
|
proxy_set_header REMOTE-HOST $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_pass http://monitor-admin/admin/;
|
proxy_pass http://monitor-admin/;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /snail-job/ {
|
location /snail-job/ {
|
||||||
|
|||||||
@ -738,10 +738,10 @@ create table sys_oper_log (
|
|||||||
oper_url varchar2(255) default '',
|
oper_url varchar2(255) default '',
|
||||||
oper_ip varchar2(128) default '',
|
oper_ip varchar2(128) default '',
|
||||||
oper_location varchar2(255) default '',
|
oper_location varchar2(255) default '',
|
||||||
oper_param varchar2(2100) default '',
|
oper_param varchar2(4000) default '',
|
||||||
json_result varchar2(2100) default '',
|
json_result varchar2(4000) default '',
|
||||||
status number(1) default 0,
|
status number(1) default 0,
|
||||||
error_msg varchar2(2100) default '',
|
error_msg varchar2(4000) default '',
|
||||||
oper_time date,
|
oper_time date,
|
||||||
cost_time number(20) default 0
|
cost_time number(20) default 0
|
||||||
);
|
);
|
||||||
|
|||||||
@ -741,10 +741,10 @@ create table if not exists sys_oper_log
|
|||||||
oper_url varchar(255) default ''::varchar,
|
oper_url varchar(255) default ''::varchar,
|
||||||
oper_ip varchar(128) default ''::varchar,
|
oper_ip varchar(128) default ''::varchar,
|
||||||
oper_location varchar(255) default ''::varchar,
|
oper_location varchar(255) default ''::varchar,
|
||||||
oper_param varchar(2000) default ''::varchar,
|
oper_param varchar(4000) default ''::varchar,
|
||||||
json_result varchar(2000) default ''::varchar,
|
json_result varchar(4000) default ''::varchar,
|
||||||
status int4 default 0,
|
status int4 default 0,
|
||||||
error_msg varchar(2000) default ''::varchar,
|
error_msg varchar(4000) default ''::varchar,
|
||||||
oper_time timestamp,
|
oper_time timestamp,
|
||||||
cost_time int8 default 0,
|
cost_time int8 default 0,
|
||||||
constraint sys_oper_log_pk primary key (oper_id)
|
constraint sys_oper_log_pk primary key (oper_id)
|
||||||
@ -1209,7 +1209,7 @@ comment on column sys_oss_config.remark is '备注';
|
|||||||
insert into sys_oss_config values (1, '000000', 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1', '0', '', 103, 1, now(), 1, now(), null);
|
insert into sys_oss_config values (1, '000000', 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1', '0', '', 103, 1, now(), 1, now(), null);
|
||||||
insert into sys_oss_config values (2, '000000', 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1', '1', '', 103, 1, now(), 1, now(), null);
|
insert into sys_oss_config values (2, '000000', 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1', '1', '', 103, 1, now(), 1, now(), null);
|
||||||
insert into sys_oss_config values (3, '000000', 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1', '1', '', 103, 1, now(), 1, now(), null);
|
insert into sys_oss_config values (3, '000000', 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1', '1', '', 103, 1, now(), 1, now(), null);
|
||||||
insert into sys_oss_config values (4, '000000', 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1250000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1', '1', '', 103, 1, now(), 1, now(), null);
|
insert into sys_oss_config values (4, '000000', 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1240000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1', '1', '', 103, 1, now(), 1, now(), null);
|
||||||
insert into sys_oss_config values (5, '000000', 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1', '1', '', 103, 1, now(), 1, now(), NULL);
|
insert into sys_oss_config values (5, '000000', 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1', '1', '', 103, 1, now(), 1, now(), NULL);
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
|
|||||||
@ -554,10 +554,10 @@ create table sys_oper_log (
|
|||||||
oper_url varchar(255) default '' comment '请求URL',
|
oper_url varchar(255) default '' comment '请求URL',
|
||||||
oper_ip varchar(128) default '' comment '主机地址',
|
oper_ip varchar(128) default '' comment '主机地址',
|
||||||
oper_location varchar(255) default '' comment '操作地点',
|
oper_location varchar(255) default '' comment '操作地点',
|
||||||
oper_param varchar(2000) default '' comment '请求参数',
|
oper_param varchar(4000) default '' comment '请求参数',
|
||||||
json_result varchar(2000) default '' comment '返回参数',
|
json_result varchar(4000) default '' comment '返回参数',
|
||||||
status int(1) default 0 comment '操作状态(0正常 1异常)',
|
status int(1) default 0 comment '操作状态(0正常 1异常)',
|
||||||
error_msg varchar(2000) default '' comment '错误消息',
|
error_msg varchar(4000) default '' comment '错误消息',
|
||||||
oper_time datetime comment '操作时间',
|
oper_time datetime comment '操作时间',
|
||||||
cost_time bigint(20) default 0 comment '消耗时间',
|
cost_time bigint(20) default 0 comment '消耗时间',
|
||||||
primary key (oper_id),
|
primary key (oper_id),
|
||||||
@ -840,7 +840,7 @@ create table sys_oss_config (
|
|||||||
insert into sys_oss_config values (1, '000000', 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1' ,'0', '', 103, 1, sysdate(), 1, sysdate(), null);
|
insert into sys_oss_config values (1, '000000', 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1' ,'0', '', 103, 1, sysdate(), 1, sysdate(), null);
|
||||||
insert into sys_oss_config values (2, '000000', 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1' ,'1', '', 103, 1, sysdate(), 1, sysdate(), null);
|
insert into sys_oss_config values (2, '000000', 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1' ,'1', '', 103, 1, sysdate(), 1, sysdate(), null);
|
||||||
insert into sys_oss_config values (3, '000000', 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1' ,'1', '', 103, 1, sysdate(), 1, sysdate(), null);
|
insert into sys_oss_config values (3, '000000', 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1' ,'1', '', 103, 1, sysdate(), 1, sysdate(), null);
|
||||||
insert into sys_oss_config values (4, '000000', 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1250000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1' ,'1', '', 103, 1, sysdate(), 1, sysdate(), null);
|
insert into sys_oss_config values (4, '000000', 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1240000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1' ,'1', '', 103, 1, sysdate(), 1, sysdate(), null);
|
||||||
insert into sys_oss_config values (5, '000000', 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1' ,'1', '', 103, 1, sysdate(), 1, sysdate(), null);
|
insert into sys_oss_config values (5, '000000', 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1' ,'1', '', 103, 1, sysdate(), 1, sysdate(), null);
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
|
|||||||
@ -2002,10 +2002,10 @@ CREATE TABLE sys_oper_log
|
|||||||
oper_url nvarchar(255) DEFAULT '' NULL,
|
oper_url nvarchar(255) DEFAULT '' NULL,
|
||||||
oper_ip nvarchar(128) DEFAULT '' NULL,
|
oper_ip nvarchar(128) DEFAULT '' NULL,
|
||||||
oper_location nvarchar(255) DEFAULT '' NULL,
|
oper_location nvarchar(255) DEFAULT '' NULL,
|
||||||
oper_param nvarchar(2000) DEFAULT '' NULL,
|
oper_param nvarchar(4000) DEFAULT '' NULL,
|
||||||
json_result nvarchar(2000) DEFAULT '' NULL,
|
json_result nvarchar(4000) DEFAULT '' NULL,
|
||||||
status int DEFAULT ((0)) NULL,
|
status int DEFAULT ((0)) NULL,
|
||||||
error_msg nvarchar(2000) DEFAULT '' NULL,
|
error_msg nvarchar(4000) DEFAULT '' NULL,
|
||||||
oper_time datetime2(7) NULL,
|
oper_time datetime2(7) NULL,
|
||||||
cost_time bigint DEFAULT ((0)) NULL,
|
cost_time bigint DEFAULT ((0)) NULL,
|
||||||
CONSTRAINT PK__sys_oper__34723BF9BD954573 PRIMARY KEY CLUSTERED (oper_id)
|
CONSTRAINT PK__sys_oper__34723BF9BD954573 PRIMARY KEY CLUSTERED (oper_id)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user