mirror of
https://github.com/setube/ogame-vue-ts.git
synced 2026-05-12 07:55:11 +08:00
fix(server): 修复静态资源拦截器路径匹配问题
- 修改路由参数匹配模式,支持更灵活的路径处理 - 确保默认路径正确映射到 index.html - 优化路径解析逻辑,提高静态资源访问准确性
This commit is contained in:
@@ -27,7 +27,7 @@ function getLocalIp() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 3. 核心:静态资源拦截器(实现单文件嵌入的关键)
|
// 3. 核心:静态资源拦截器(实现单文件嵌入的关键)
|
||||||
app.get('/*', async (req, res) => {
|
app.get('/:path*', async (req, res) => {
|
||||||
// 处理请求路径,默认为 index.html
|
// 处理请求路径,默认为 index.html
|
||||||
let reqPath = req.path === '/' ? '/index.html' : req.path;
|
let reqPath = req.path === '/' ? '/index.html' : req.path;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user