feat(grouping): 新增分组功能并优化 Markdown 文件操作
- 新增分组实体、控制器、服务和映射器 - 实现分组创建、获取、更新和删除接口 - 优化 Markdown 文件创建、获取和删除接口- 新增全局异常处理和日志记录 - 更新数据库表结构和字段类型 - 重构前端页面,支持分组和 Markdown 文件展示
This commit is contained in:
@@ -42,6 +42,13 @@ public class Knife4jConfig {
|
||||
.pathsToMatch("/api/user/**")
|
||||
.build();
|
||||
}
|
||||
@Bean
|
||||
public GroupedOpenApi GroupingApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("分组接口")
|
||||
.pathsToMatch("/api/groupings/**")
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -11,11 +11,11 @@ public class WebConfig implements WebMvcConfigurer {
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**")
|
||||
.allowedOrigins("*")
|
||||
.allowedOrigins("http://localhost:5173") // 明确指定前端来源
|
||||
.allowedMethods("*")
|
||||
.allowedHeaders("*")
|
||||
.allowCredentials(true) // 允许凭证
|
||||
.maxAge(3600); // 预检请求缓存时间
|
||||
;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -23,4 +23,4 @@ public class WebConfig implements WebMvcConfigurer {
|
||||
registry.addResourceHandler("/uploads/**")
|
||||
.addResourceLocations("file:uploads/");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user