功能管理,完成

This commit is contained in:
2026-01-20 15:33:13 +08:00
parent bd2b0e7f3d
commit c8e168e4c4
46 changed files with 1508 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
package com.cczsa.xinghe.codegen.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* @author xia
* @date 2026/1/20
* @version 0.0.1
*/
@Configuration
public class WebConfig implements WebMvcConfigurer {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
// 将所有非 API 的路径转发到 index.html
// 注意:这里假设你的 API 请求都有 /api 前缀
registry.addViewController("/{path:[^\\.]*}")
.setViewName("forward:/index.html");
// 针对多级路径的递归处理(可选)
registry.addViewController("/**/{path:[^\\.]*}")
.setViewName("forward:/index.html");
}
}