From 5193f9bcec419d2e53d74c79103e447166604232 Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Wed, 1 Nov 2023 18:02:53 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E4=BF=AE=E6=94=B9=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E4=BC=81=E6=A0=87=E8=AF=A6=E6=83=85=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/permission.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/permission.js b/src/permission.js index 5157e9ec..678e038b 100644 --- a/src/permission.js +++ b/src/permission.js @@ -75,6 +75,9 @@ router.beforeEach(async (to, from, next) => { redirect = redirect.substring(0, redirect.indexOf('code')) } if (to.path === redirect) { + // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + next({ ...to, replace: true }) + } else { if (to.path === '/enterpriseStandardLibrary/enterpriseStandardDetail') { // 跳企标详情,需要判断是否能看详情 const params = {} @@ -85,18 +88,15 @@ router.beforeEach(async (to, from, next) => { } isCanLookDetail(params).then(res => { if (res.success && res.result) { - next({ ...to, replace: true }) + next({ path: redirect }) } else { next({ path: '/404' }) } }) } else { - // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record - next({ ...to, replace: true }) + // 跳转到目的路由 + next({ path: redirect }) } - } else { - // 跳转到目的路由 - next({ path: redirect }) } }) })