mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-08 16:57:09 +08:00
refactor: 新增 PATH_PATTERN 字符串常量
This commit is contained in:
@@ -58,4 +58,9 @@ public class StringConstants implements StrPool {
|
||||
* 中文逗号
|
||||
*/
|
||||
public static final String CHINESE_COMMA = ",";
|
||||
|
||||
/**
|
||||
* 路径模式
|
||||
*/
|
||||
public static final String PATH_PATTERN = "/**";
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ public class LocalStorageAutoConfiguration implements WebMvcConfigurer {
|
||||
if (StrUtil.isBlank(location)) {
|
||||
throw new IllegalArgumentException(String.format("Path pattern [%s] location is null.", pathPattern));
|
||||
}
|
||||
registry.addResourceHandler(pathPattern)
|
||||
registry.addResourceHandler(StrUtil.appendIfMissing(pathPattern, StringConstants.PATH_PATTERN))
|
||||
.addResourceLocations(!location.startsWith("file:") ? String.format("file:%s", this.format(location)) : this.format(location))
|
||||
.setCachePeriod(0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user