修改contentType编码.
This commit is contained in:
@@ -22,6 +22,8 @@ import java.util.Collections;
|
|||||||
*/
|
*/
|
||||||
public class SecurityUtils {
|
public class SecurityUtils {
|
||||||
|
|
||||||
|
private static final int BEARER_PREFIX_LEN = 7;
|
||||||
|
|
||||||
private SecurityUtils() {
|
private SecurityUtils() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,10 +38,10 @@ public class SecurityUtils {
|
|||||||
if (Strings.isEmpty(authorization)) {
|
if (Strings.isEmpty(authorization)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (!authorization.contains(Const.BEARER) || authorization.length() <= 7) {
|
if (!authorization.contains(Const.BEARER) || authorization.length() <= BEARER_PREFIX_LEN) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return authorization.substring(7).trim();
|
return authorization.substring(BEARER_PREFIX_LEN).trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import org.springframework.web.filter.CorsFilter;
|
|||||||
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
|
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -94,7 +95,9 @@ public class OrionWebAutoConfiguration implements WebMvcConfigurer {
|
|||||||
SerializerFeature.WriteNullListAsEmpty,
|
SerializerFeature.WriteNullListAsEmpty,
|
||||||
SerializerFeature.IgnoreNonFieldGetter
|
SerializerFeature.IgnoreNonFieldGetter
|
||||||
);
|
);
|
||||||
|
config.setCharset(StandardCharsets.UTF_8);
|
||||||
converter.setFastJsonConfig(config);
|
converter.setFastJsonConfig(config);
|
||||||
|
converter.setDefaultCharset(StandardCharsets.UTF_8);
|
||||||
return converter;
|
return converter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user