31 lines
1.3 KiB
Java
31 lines
1.3 KiB
Java
package com.onekeycall.videotablet.config;
|
|
|
|
import com.onekeycall.videotablet.interceptor.TokenInterceptor;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
@Configuration
|
|
public class WebConfig implements WebMvcConfigurer {
|
|
// @Autowired
|
|
// private TokenInterceptor tokenInterceptor;
|
|
//
|
|
// @Override
|
|
// public void addInterceptors(InterceptorRegistry registry) {
|
|
// registry.addInterceptor(tokenInterceptor)
|
|
// .addPathPatterns("/user/**") // 保护用户相关端点
|
|
// .excludePathPatterns("/public/**"); // 开放登录注册
|
|
// }
|
|
|
|
@Override
|
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
|
registry.addResourceHandler("/uploadFile/**")
|
|
.addResourceLocations("file:uploadFile/");
|
|
registry.addResourceHandler("/data/uploads/**")
|
|
.addResourceLocations("file:/data/uploads/");
|
|
}
|
|
}
|