fix(server): 修复静态资源拦截器路径匹配问题

- 将路由从 '*' 更改为 '/*' 以正确处理所有路径
- 确保默认路径 '/' 正确映射到 '/index.html'
- 优化路径处理逻辑以增强单文件嵌入功能
This commit is contained in:
coolxitech
2025-12-13 14:13:36 +08:00
parent cd14e88cc0
commit fc481507f0

View File

@@ -27,7 +27,7 @@ function getLocalIp() {
}
// 3. 核心:静态资源拦截器(实现单文件嵌入的关键)
app.get('*', async (req, res) => {
app.get('/*', async (req, res) => {
// 处理请求路径,默认为 index.html
let reqPath = req.path === '/' ? '/index.html' : req.path;