From 467557fef3a7013cdbf6c3588a3073775efc8bfe Mon Sep 17 00:00:00 2001
From: 颜奕强 <jyuyyq@163.com>
Date: Mon, 08 Aug 2022 20:29:03 +0800
Subject: [PATCH] update ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java. * update: 数字类型应该转为double输出。若使用string输出,会导致生成的单元格变成文本类型。
---
ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/BlackListUrlFilter.java | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/BlackListUrlFilter.java b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/BlackListUrlFilter.java
index f613dea..ec7801b 100644
--- a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/BlackListUrlFilter.java
+++ b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/BlackListUrlFilter.java
@@ -5,11 +5,8 @@
import java.util.regex.Pattern;
import org.springframework.cloud.gateway.filter.GatewayFilter;
import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
-import org.springframework.http.server.reactive.ServerHttpResponse;
import org.springframework.stereotype.Component;
-import com.alibaba.fastjson.JSON;
-import com.ruoyi.common.core.web.domain.AjaxResult;
-import reactor.core.publisher.Mono;
+import com.ruoyi.common.core.utils.ServletUtils;
/**
* 黑名单过滤器
@@ -27,10 +24,7 @@
String url = exchange.getRequest().getURI().getPath();
if (config.matchBlacklist(url))
{
- ServerHttpResponse response = exchange.getResponse();
- response.getHeaders().add("Content-Type", "application/json;charset=UTF-8");
- return exchange.getResponse().writeWith(
- Mono.just(response.bufferFactory().wrap(JSON.toJSONBytes(AjaxResult.error("请求地址不允许访问")))));
+ return ServletUtils.webFluxResponseWriter(exchange.getResponse(), "请求地址不允许访问");
}
return chain.filter(exchange);
@@ -50,7 +44,7 @@
public boolean matchBlacklist(String url)
{
- return blacklistUrlPattern.isEmpty() ? false : blacklistUrlPattern.stream().filter(p -> p.matcher(url).find()).findAny().isPresent();
+ return !blacklistUrlPattern.isEmpty() && blacklistUrlPattern.stream().anyMatch(p -> p.matcher(url).find());
}
public List<String> getBlacklistUrl()
--
Gitblit v1.9.3