|
|
@ -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) { |
|
|
|