bug fix
This commit is contained in:
parent
6529683482
commit
fe1399b437
|
@ -49,20 +49,6 @@ app.use(['/api', '/admins', '/attachments', '/oauth', '/competitions'], (req, re
|
|||
proxy(req, res);
|
||||
});
|
||||
|
||||
// 中间件,用于排除特定的路径
|
||||
function excludePath(req, res, next) {
|
||||
// 检查请求的路径是否需要被排除
|
||||
if (req.path.includes('/build/')) {
|
||||
// 如果是,直接结束请求,不调用下一个中间件或路由处理器
|
||||
res.status(404).send('This path is excluded.');
|
||||
} else {
|
||||
// 如果不是,继续执行下一个中间件或路由处理器
|
||||
next();
|
||||
}
|
||||
}
|
||||
// 应用中间件到所有路由
|
||||
app.use(excludePath);
|
||||
|
||||
// 匹配路径,匹配到的返回处理后的html,没匹配到转发到后端
|
||||
app.get('*',async function (req,res) {
|
||||
global.domObj = getDomObj()
|
||||
|
|
Loading…
Reference in New Issue