diff --git a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/constant/StringConstants.java b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/constant/StringConstants.java index ca67757a..3017bb20 100644 --- a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/constant/StringConstants.java +++ b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/constant/StringConstants.java @@ -58,4 +58,9 @@ public class StringConstants implements StrPool { * 中文逗号 */ public static final String CHINESE_COMMA = ","; + + /** + * 路径模式 + */ + public static final String PATH_PATTERN = "/**"; } diff --git a/continew-starter-storage/continew-starter-storage-local/src/main/java/top/charles7c/continew/starter/storage/local/autoconfigure/LocalStorageAutoConfiguration.java b/continew-starter-storage/continew-starter-storage-local/src/main/java/top/charles7c/continew/starter/storage/local/autoconfigure/LocalStorageAutoConfiguration.java index b8f8e225..287b24d3 100644 --- a/continew-starter-storage/continew-starter-storage-local/src/main/java/top/charles7c/continew/starter/storage/local/autoconfigure/LocalStorageAutoConfiguration.java +++ b/continew-starter-storage/continew-starter-storage-local/src/main/java/top/charles7c/continew/starter/storage/local/autoconfigure/LocalStorageAutoConfiguration.java @@ -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); }