spring boot + security 映射 本地磁盘 静态文件 实现在线预览
- 配置文件中增加:
resources:
static-locations: file:E:\\test\\
mvc:
static-path-pattern: /files/** #改配置是请求路径 缩写
- 开放权限(本人这里是 security)
@Configuration
@Slf4j
public class InterceptorConfig extends WebMvcConfigurationSupport {
//静态资源拦截器
@Override
protected void addResourceHandlers(