From a2a7810c8a5dbcbb05e7724c61ae0db0f1328cc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=BF=83=E5=AE=87?= Date: Sat, 11 May 2024 14:03:42 +0800 Subject: [PATCH] =?UTF-8?q?route=20=E7=B2=BE=E7=A1=AE=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/render.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {