mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 19:49:19 +08:00
完成媒体管理模块
This commit is contained in:
+1
-2
@@ -20,11 +20,9 @@ import top.xyquan.ecomdmbbackend.utils.JwtUtils;
|
||||
@EnableWebSecurity
|
||||
public class SecurityConfig {
|
||||
|
||||
private final JwtUtils jwtUtils;
|
||||
private final JwtAuthenticationFilter jwtAuthenticationFilter;
|
||||
|
||||
public SecurityConfig(JwtUtils jwtUtils, JwtAuthenticationFilter jwtAuthenticationFilter) {
|
||||
this.jwtUtils = jwtUtils;
|
||||
this.jwtAuthenticationFilter = jwtAuthenticationFilter;
|
||||
}
|
||||
|
||||
@@ -40,6 +38,7 @@ public class SecurityConfig {
|
||||
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
|
||||
.authorizeHttpRequests(auth -> auth
|
||||
.requestMatchers("/auth/**").permitAll()
|
||||
.requestMatchers("/uploads/**").permitAll() // 允许直接访问上传的文件
|
||||
.requestMatchers("/doc.html", "/webjars/**", "/v3/api-docs/**", "/swagger-resources/**",
|
||||
"/swagger-ui/**", "/swagger-ui.html")
|
||||
.permitAll()
|
||||
|
||||
+2
-2
@@ -18,8 +18,8 @@ public class WebConfig implements WebMvcConfigurer {
|
||||
.addResourceLocations("classpath:/static/");
|
||||
|
||||
// 配置上传文件访问 - 使用绝对路径
|
||||
registry.addResourceHandler("/static/uploads/**")
|
||||
.addResourceLocations("file:./static/uploads/");
|
||||
registry.addResourceHandler("/uploads/**")
|
||||
.addResourceLocations("file:./uploads/");
|
||||
|
||||
// 配置Swagger UI资源
|
||||
registry.addResourceHandler("/swagger-ui/**")
|
||||
|
||||
Reference in New Issue
Block a user