Merge remote-tracking branch 'origin/dev' into warm-flow-future
This commit is contained in:
commit
7430fa58bf
7
pom.xml
7
pom.xml
@ -27,7 +27,6 @@
|
|||||||
<mybatis-plus.version>3.5.7</mybatis-plus.version>
|
<mybatis-plus.version>3.5.7</mybatis-plus.version>
|
||||||
<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>
|
||||||
<okhttp.version>4.10.0</okhttp.version>
|
|
||||||
<spring-boot-admin.version>3.2.3</spring-boot-admin.version>
|
<spring-boot-admin.version>3.2.3</spring-boot-admin.version>
|
||||||
<redisson.version>3.34.1</redisson.version>
|
<redisson.version>3.34.1</redisson.version>
|
||||||
<lock4j.version>2.2.7</lock4j.version>
|
<lock4j.version>2.2.7</lock4j.version>
|
||||||
@ -230,12 +229,6 @@
|
|||||||
<version>${p6spy.version}</version>
|
<version>${p6spy.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.squareup.okhttp3</groupId>
|
|
||||||
<artifactId>okhttp</artifactId>
|
|
||||||
<version>${okhttp.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- AWS SDK for Java 2.x -->
|
<!-- AWS SDK for Java 2.x -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>software.amazon.awssdk</groupId>
|
<groupId>software.amazon.awssdk</groupId>
|
||||||
|
@ -223,9 +223,10 @@ xss:
|
|||||||
# 过滤开关
|
# 过滤开关
|
||||||
enabled: true
|
enabled: true
|
||||||
# 排除链接(多个用逗号分隔)
|
# 排除链接(多个用逗号分隔)
|
||||||
excludes: /system/notice
|
excludeUrls:
|
||||||
# 匹配链接
|
- /system/notice
|
||||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
- /workflow/model/save
|
||||||
|
- /workflow/model/editModelXml
|
||||||
|
|
||||||
# 全局线程池相关配置
|
# 全局线程池相关配置
|
||||||
# 如使用JDK21请直接使用虚拟线程 不要开启此配置
|
# 如使用JDK21请直接使用虚拟线程 不要开启此配置
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package org.dromara.common.tenant.helper;
|
package org.dromara.common.tenant.helper;
|
||||||
|
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
@ -130,7 +129,7 @@ public class TenantHelper {
|
|||||||
if (!isEnable()) {
|
if (!isEnable()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!isLogin() || !global) {
|
if (!LoginHelper.isLogin() || !global) {
|
||||||
TEMP_DYNAMIC_TENANT.set(tenantId);
|
TEMP_DYNAMIC_TENANT.set(tenantId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -147,7 +146,7 @@ public class TenantHelper {
|
|||||||
if (!isEnable()) {
|
if (!isEnable()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (!isLogin()) {
|
if (!LoginHelper.isLogin()) {
|
||||||
return TEMP_DYNAMIC_TENANT.get();
|
return TEMP_DYNAMIC_TENANT.get();
|
||||||
}
|
}
|
||||||
// 如果线程内有值 优先返回
|
// 如果线程内有值 优先返回
|
||||||
@ -167,7 +166,7 @@ public class TenantHelper {
|
|||||||
if (!isEnable()) {
|
if (!isEnable()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!isLogin()) {
|
if (!LoginHelper.isLogin()) {
|
||||||
TEMP_DYNAMIC_TENANT.remove();
|
TEMP_DYNAMIC_TENANT.remove();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -218,13 +217,4 @@ public class TenantHelper {
|
|||||||
return tenantId;
|
return tenantId;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isLogin() {
|
|
||||||
try {
|
|
||||||
StpUtil.checkLogin();
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
package org.dromara.common.web.config;
|
package org.dromara.common.web.config;
|
||||||
|
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import jakarta.servlet.DispatcherType;
|
||||||
import org.dromara.common.web.config.properties.XssProperties;
|
import org.dromara.common.web.config.properties.XssProperties;
|
||||||
import org.dromara.common.web.filter.RepeatableFilter;
|
import org.dromara.common.web.filter.RepeatableFilter;
|
||||||
import org.dromara.common.web.filter.XssFilter;
|
import org.dromara.common.web.filter.XssFilter;
|
||||||
import jakarta.servlet.DispatcherType;
|
|
||||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter配置
|
* Filter配置
|
||||||
*
|
*
|
||||||
@ -30,12 +26,9 @@ public class FilterConfig {
|
|||||||
FilterRegistrationBean registration = new FilterRegistrationBean();
|
FilterRegistrationBean registration = new FilterRegistrationBean();
|
||||||
registration.setDispatcherTypes(DispatcherType.REQUEST);
|
registration.setDispatcherTypes(DispatcherType.REQUEST);
|
||||||
registration.setFilter(new XssFilter());
|
registration.setFilter(new XssFilter());
|
||||||
registration.addUrlPatterns(StringUtils.split(xssProperties.getUrlPatterns(), StringUtils.SEPARATOR));
|
registration.addUrlPatterns("/*");
|
||||||
registration.setName("xssFilter");
|
registration.setName("xssFilter");
|
||||||
registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE);
|
registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE);
|
||||||
Map<String, String> initParameters = new HashMap<>();
|
|
||||||
initParameters.put("excludes", xssProperties.getExcludes());
|
|
||||||
registration.setInitParameters(initParameters);
|
|
||||||
return registration;
|
return registration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,9 @@ package org.dromara.common.web.config.properties;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xss过滤 配置属性
|
* xss过滤 配置属性
|
||||||
*
|
*
|
||||||
@ -13,18 +16,13 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
|||||||
public class XssProperties {
|
public class XssProperties {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 过滤开关
|
* Xss开关
|
||||||
*/
|
*/
|
||||||
private String enabled;
|
private Boolean enabled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 排除链接(多个用逗号分隔)
|
* 排除路径
|
||||||
*/
|
*/
|
||||||
private String excludes;
|
private List<String> excludeUrls = new ArrayList<>();
|
||||||
|
|
||||||
/**
|
|
||||||
* 匹配链接
|
|
||||||
*/
|
|
||||||
private String urlPatterns;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package org.dromara.common.web.filter;
|
package org.dromara.common.web.filter;
|
||||||
|
|
||||||
|
import org.dromara.common.core.utils.SpringUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.web.config.properties.XssProperties;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
|
|
||||||
import jakarta.servlet.*;
|
import jakarta.servlet.*;
|
||||||
@ -23,13 +25,8 @@ public class XssFilter implements Filter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(FilterConfig filterConfig) throws ServletException {
|
public void init(FilterConfig filterConfig) throws ServletException {
|
||||||
String tempExcludes = filterConfig.getInitParameter("excludes");
|
XssProperties properties = SpringUtils.getBean(XssProperties.class);
|
||||||
if (StringUtils.isNotEmpty(tempExcludes)) {
|
excludes.addAll(properties.getExcludeUrls());
|
||||||
String[] url = tempExcludes.split(StringUtils.SEPARATOR);
|
|
||||||
for (int i = 0; url != null && i < url.length; i++) {
|
|
||||||
excludes.add(url[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -16,6 +16,18 @@
|
|||||||
<groupId>com.aizuda</groupId>
|
<groupId>com.aizuda</groupId>
|
||||||
<artifactId>snail-job-server-starter</artifactId>
|
<artifactId>snail-job-server-starter</artifactId>
|
||||||
<version>${snailjob.version}</version>
|
<version>${snailjob.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.scala-lang</groupId>
|
||||||
|
<artifactId>scala-library</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.scala-lang</groupId>
|
||||||
|
<artifactId>scala-library</artifactId>
|
||||||
|
<version>2.13.9</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -2,10 +2,8 @@ package org.dromara.generator.mapper;
|
|||||||
|
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
import org.dromara.generator.domain.GenTable;
|
import org.dromara.generator.domain.GenTable;
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -40,6 +38,14 @@ public interface GenTableMapper extends BaseMapperPlus<GenTable, GenTable> {
|
|||||||
*/
|
*/
|
||||||
GenTable selectGenTableByName(String tableName);
|
GenTable selectGenTableByName(String tableName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定数据源下的所有表名列表
|
||||||
|
*
|
||||||
|
* @param dataName 数据源名称,用于选择不同的数据源
|
||||||
|
* @return 当前数据库中的表名列表
|
||||||
|
*
|
||||||
|
* @DS("") 使用默认数据源执行查询操作
|
||||||
|
*/
|
||||||
@DS("")
|
@DS("")
|
||||||
List<String> selectTableNameList(String dataName);
|
List<String> selectTableNameList(String dataName);
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package org.dromara.system.listener;
|
|||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.crypto.digest.BCrypt;
|
import cn.hutool.crypto.digest.BCrypt;
|
||||||
|
import cn.hutool.http.HtmlUtil;
|
||||||
import com.alibaba.excel.context.AnalysisContext;
|
import com.alibaba.excel.context.AnalysisContext;
|
||||||
import com.alibaba.excel.event.AnalysisEventListener;
|
import com.alibaba.excel.event.AnalysisEventListener;
|
||||||
import jakarta.validation.ConstraintViolation;
|
import jakarta.validation.ConstraintViolation;
|
||||||
@ -82,7 +83,7 @@ public class SysUserImportListener extends AnalysisEventListener<SysUserImportVo
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
failureNum++;
|
failureNum++;
|
||||||
String msg = "<br/>" + failureNum + "、账号 " + userVo.getUserName() + " 导入失败:";
|
String msg = "<br/>" + failureNum + "、账号 " + HtmlUtil.cleanHtmlTag(userVo.getUserName()) + " 导入失败:";
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
if (e instanceof ConstraintViolationException cvException) {
|
if (e instanceof ConstraintViolationException cvException) {
|
||||||
message = StreamUtils.join(cvException.getConstraintViolations(), ConstraintViolation::getMessage, ", ");
|
message = StreamUtils.join(cvException.getConstraintViolations(), ConstraintViolation::getMessage, ", ");
|
||||||
|
@ -268,7 +268,9 @@ public class SysTenantServiceImpl implements ISysTenantService {
|
|||||||
@CacheEvict(cacheNames = CacheNames.SYS_TENANT, key = "#bo.tenantId")
|
@CacheEvict(cacheNames = CacheNames.SYS_TENANT, key = "#bo.tenantId")
|
||||||
@Override
|
@Override
|
||||||
public int updateTenantStatus(SysTenantBo bo) {
|
public int updateTenantStatus(SysTenantBo bo) {
|
||||||
SysTenant tenant = MapstructUtils.convert(bo, SysTenant.class);
|
SysTenant tenant = new SysTenant();
|
||||||
|
tenant.setId(bo.getId());
|
||||||
|
tenant.setStatus(bo.getStatus());
|
||||||
return baseMapper.updateById(tenant);
|
return baseMapper.updateById(tenant);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user