diff --git a/server/render.js b/server/render.js index b19741ec9..c2f617527 100644 --- a/server/render.js +++ b/server/render.js @@ -24,7 +24,7 @@ export const render = async (req,res)=>{ function matchSubRoutes(routes, url) { for (const route of routes) { // 检查当前路由是否匹配 - let match = matchPath(url, route.path); + let match = matchPath(url, { path: route.path, exact: true }); if (match) { // 如果当前路由匹配,并且它有子路由,递归检查子路由 if (route.routes) {