mirror of https://gitee.com/topiam/eiam
⚡ 替换过时常量
parent
946f7d2c17
commit
fc8ddca830
|
@ -18,12 +18,12 @@
|
||||||
package cn.topiam.employee.protocol.form.endpoint;
|
package cn.topiam.employee.protocol.form.endpoint;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.commons.compress.utils.CharsetNames;
|
|
||||||
import org.apache.http.entity.ContentType;
|
import org.apache.http.entity.ContentType;
|
||||||
import org.springframework.core.log.LogMessage;
|
import org.springframework.core.log.LogMessage;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
@ -207,7 +207,7 @@ public final class FormAuthenticationEndpointFilter extends OncePerRequestFilter
|
||||||
FormAuthenticationToken authenticationToken = (FormAuthenticationToken) authentication;
|
FormAuthenticationToken authenticationToken = (FormAuthenticationToken) authentication;
|
||||||
FormProtocolConfig config = authenticationToken.getConfig();
|
FormProtocolConfig config = authenticationToken.getConfig();
|
||||||
try {
|
try {
|
||||||
response.setCharacterEncoding(CharsetNames.UTF_8);
|
response.setCharacterEncoding(StandardCharsets.UTF_8.name());
|
||||||
response.setContentType(ContentType.TEXT_HTML.getMimeType());
|
response.setContentType(ContentType.TEXT_HTML.getMimeType());
|
||||||
Template template = freemarkerTemplateConfiguration.getTemplate("form_redirect.ftlh");
|
Template template = freemarkerTemplateConfiguration.getTemplate("form_redirect.ftlh");
|
||||||
Map<String, Object> data = new HashMap<>(16);
|
Map<String, Object> data = new HashMap<>(16);
|
||||||
|
@ -257,7 +257,7 @@ public final class FormAuthenticationEndpointFilter extends OncePerRequestFilter
|
||||||
freemarkerTemplateConfiguration
|
freemarkerTemplateConfiguration
|
||||||
.setTemplateLoader(new ClassTemplateLoader(this.getClass(), "/template/"));
|
.setTemplateLoader(new ClassTemplateLoader(this.getClass(), "/template/"));
|
||||||
//编码
|
//编码
|
||||||
freemarkerTemplateConfiguration.setDefaultEncoding(CharsetNames.UTF_8);
|
freemarkerTemplateConfiguration.setDefaultEncoding(StandardCharsets.UTF_8.name());
|
||||||
//国际化
|
//国际化
|
||||||
freemarkerTemplateConfiguration.setLocale(new Locale("zh_CN"));
|
freemarkerTemplateConfiguration.setLocale(new Locale("zh_CN"));
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
|
|
|
@ -18,12 +18,12 @@
|
||||||
package cn.topiam.employee.protocol.jwt.endpoint;
|
package cn.topiam.employee.protocol.jwt.endpoint;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import org.apache.commons.compress.utils.CharsetNames;
|
|
||||||
import org.apache.http.entity.ContentType;
|
import org.apache.http.entity.ContentType;
|
||||||
import org.springframework.core.log.LogMessage;
|
import org.springframework.core.log.LogMessage;
|
||||||
import org.springframework.lang.NonNull;
|
import org.springframework.lang.NonNull;
|
||||||
|
@ -200,7 +200,7 @@ public final class JwtLoginAuthenticationEndpointFilter extends OncePerRequestFi
|
||||||
JwtProtocolConfig config = authenticationToken.getConfig();
|
JwtProtocolConfig config = authenticationToken.getConfig();
|
||||||
IdToken idToken = authenticationToken.getIdToken();
|
IdToken idToken = authenticationToken.getIdToken();
|
||||||
String targetUri = Objects.toString(authenticationToken.getTargetUrl(), config.getTargetLinkUrl());
|
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());
|
response.setContentType(ContentType.TEXT_HTML.getMimeType());
|
||||||
try {
|
try {
|
||||||
Template template = freemarkerTemplateConfiguration.getTemplate("jwt_redirect.ftlh");
|
Template template = freemarkerTemplateConfiguration.getTemplate("jwt_redirect.ftlh");
|
||||||
|
@ -225,7 +225,7 @@ public final class JwtLoginAuthenticationEndpointFilter extends OncePerRequestFi
|
||||||
freemarkerTemplateConfiguration
|
freemarkerTemplateConfiguration
|
||||||
.setTemplateLoader(new ClassTemplateLoader(this.getClass(), "/template/"));
|
.setTemplateLoader(new ClassTemplateLoader(this.getClass(), "/template/"));
|
||||||
//编码
|
//编码
|
||||||
freemarkerTemplateConfiguration.setDefaultEncoding(CharsetNames.UTF_8);
|
freemarkerTemplateConfiguration.setDefaultEncoding(StandardCharsets.UTF_8.name());
|
||||||
//国际化
|
//国际化
|
||||||
freemarkerTemplateConfiguration.setLocale(new Locale("zh_CN"));
|
freemarkerTemplateConfiguration.setLocale(new Locale("zh_CN"));
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
|
|
Loading…
Reference in New Issue