From fc8ddca83019df2757ac6927321c45ac5d2be401 Mon Sep 17 00:00:00 2001 From: awenes <1121353141@qq.com> Date: Sun, 20 Oct 2024 22:46:49 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E6=9B=BF=E6=8D=A2=E8=BF=87=E6=97=B6?= =?UTF-8?q?=E5=B8=B8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/endpoint/FormAuthenticationEndpointFilter.java | 6 +++--- .../jwt/endpoint/JwtLoginAuthenticationEndpointFilter.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eiam-protocol/eiam-protocol-form/src/main/java/cn/topiam/employee/protocol/form/endpoint/FormAuthenticationEndpointFilter.java b/eiam-protocol/eiam-protocol-form/src/main/java/cn/topiam/employee/protocol/form/endpoint/FormAuthenticationEndpointFilter.java index 846f79c1..a7eec44e 100644 --- a/eiam-protocol/eiam-protocol-form/src/main/java/cn/topiam/employee/protocol/form/endpoint/FormAuthenticationEndpointFilter.java +++ b/eiam-protocol/eiam-protocol-form/src/main/java/cn/topiam/employee/protocol/form/endpoint/FormAuthenticationEndpointFilter.java @@ -18,12 +18,12 @@ package cn.topiam.employee.protocol.form.endpoint; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; -import org.apache.commons.compress.utils.CharsetNames; import org.apache.http.entity.ContentType; import org.springframework.core.log.LogMessage; import org.springframework.http.HttpStatus; @@ -207,7 +207,7 @@ public final class FormAuthenticationEndpointFilter extends OncePerRequestFilter FormAuthenticationToken authenticationToken = (FormAuthenticationToken) authentication; FormProtocolConfig config = authenticationToken.getConfig(); try { - response.setCharacterEncoding(CharsetNames.UTF_8); + response.setCharacterEncoding(StandardCharsets.UTF_8.name()); response.setContentType(ContentType.TEXT_HTML.getMimeType()); Template template = freemarkerTemplateConfiguration.getTemplate("form_redirect.ftlh"); Map data = new HashMap<>(16); @@ -257,7 +257,7 @@ public final class FormAuthenticationEndpointFilter extends OncePerRequestFilter freemarkerTemplateConfiguration .setTemplateLoader(new ClassTemplateLoader(this.getClass(), "/template/")); //编码 - freemarkerTemplateConfiguration.setDefaultEncoding(CharsetNames.UTF_8); + freemarkerTemplateConfiguration.setDefaultEncoding(StandardCharsets.UTF_8.name()); //国际化 freemarkerTemplateConfiguration.setLocale(new Locale("zh_CN")); } catch (Exception exception) { diff --git a/eiam-protocol/eiam-protocol-jwt/src/main/java/cn/topiam/employee/protocol/jwt/endpoint/JwtLoginAuthenticationEndpointFilter.java b/eiam-protocol/eiam-protocol-jwt/src/main/java/cn/topiam/employee/protocol/jwt/endpoint/JwtLoginAuthenticationEndpointFilter.java index 116a19c5..06545a15 100644 --- a/eiam-protocol/eiam-protocol-jwt/src/main/java/cn/topiam/employee/protocol/jwt/endpoint/JwtLoginAuthenticationEndpointFilter.java +++ b/eiam-protocol/eiam-protocol-jwt/src/main/java/cn/topiam/employee/protocol/jwt/endpoint/JwtLoginAuthenticationEndpointFilter.java @@ -18,12 +18,12 @@ package cn.topiam.employee.protocol.jwt.endpoint; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Locale; import java.util.Map; import java.util.Objects; -import org.apache.commons.compress.utils.CharsetNames; import org.apache.http.entity.ContentType; import org.springframework.core.log.LogMessage; import org.springframework.lang.NonNull; @@ -200,7 +200,7 @@ public final class JwtLoginAuthenticationEndpointFilter extends OncePerRequestFi JwtProtocolConfig config = authenticationToken.getConfig(); IdToken idToken = authenticationToken.getIdToken(); String targetUri = Objects.toString(authenticationToken.getTargetUrl(), config.getTargetLinkUrl()); - response.setCharacterEncoding(CharsetNames.UTF_8); + response.setCharacterEncoding(StandardCharsets.UTF_8.name()); response.setContentType(ContentType.TEXT_HTML.getMimeType()); try { Template template = freemarkerTemplateConfiguration.getTemplate("jwt_redirect.ftlh"); @@ -225,7 +225,7 @@ public final class JwtLoginAuthenticationEndpointFilter extends OncePerRequestFi freemarkerTemplateConfiguration .setTemplateLoader(new ClassTemplateLoader(this.getClass(), "/template/")); //编码 - freemarkerTemplateConfiguration.setDefaultEncoding(CharsetNames.UTF_8); + freemarkerTemplateConfiguration.setDefaultEncoding(StandardCharsets.UTF_8.name()); //国际化 freemarkerTemplateConfiguration.setLocale(new Locale("zh_CN")); } catch (Exception exception) {