处理文件配置
This commit is contained in:
parent
55d7a0ea6e
commit
70b899df41
@ -37,7 +37,7 @@ public class WebConfig implements WebMvcConfigurer {
|
||||
// 上传文件的直接访问地址
|
||||
if (!StringUtils.isBlank(fileProperties.getUploadPath())) {
|
||||
// 静态文件
|
||||
registry.addResourceHandler("/static-files/**").addResourceLocations("file:" + fileProperties.getUploadPath());
|
||||
registry.addResourceHandler("/files/**").addResourceLocations("file:" + fileProperties.getUploadPath());
|
||||
}
|
||||
if (!StringUtils.isBlank(webProperties.getPath())) {
|
||||
// 网站
|
||||
|
@ -194,7 +194,7 @@ public class FileComponent {
|
||||
if (fileUrl.startsWith("/")) {
|
||||
fileUrl = fileUrl.substring(1, fileUrl.length() - 1);
|
||||
}
|
||||
return fileUrl;
|
||||
return "files/" + fileUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user