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

- 修改路由参数匹配模式,支持更灵活的路径处理
- 确保默认路径正确映射到 index.html
- 优化路径解析逻辑,提高静态资源访问准确性
This commit is contained in:
coolxitech
2025-12-13 14:19:10 +08:00
parent fc481507f0
commit b758c6e84d

View File

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