feat: 在线编辑创建空文件并映射外部
This commit is contained in:
@@ -38,6 +38,8 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
|
||||
private String webAppPath;
|
||||
@Value("${spring.resource.static-locations}")
|
||||
private String staticLocations;
|
||||
@Value("${file.path}")
|
||||
private String filePath;
|
||||
|
||||
/**
|
||||
* 静态资源的配置 - 使得可以从磁盘中读取 Html、图片、视频、音频等
|
||||
@@ -47,6 +49,10 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
|
||||
registry.addResourceHandler("/**")
|
||||
.addResourceLocations("file:" + upLoadPath + "//", "file:" + webAppPath + "//")
|
||||
.addResourceLocations(staticLocations.split(","));
|
||||
|
||||
// 映射在线编辑文件存储路径
|
||||
registry.addResourceHandler("/file/**")
|
||||
.addResourceLocations("file:" + filePath);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -144,6 +144,7 @@ public class ShiroConfig {
|
||||
|
||||
//onlyoffice排除
|
||||
filterChainDefinitionMap.put("/onlyOffice/**", "anon");
|
||||
filterChainDefinitionMap.put("/file/**", "anon");
|
||||
|
||||
//对接接口排除
|
||||
filterChainDefinitionMap.put("/sync/**", "anon");
|
||||
|
||||
Reference in New Issue
Block a user