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('/*', 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