From f19a3025e13530898267a4bf1fab04d2ab36392e Mon Sep 17 00:00:00 2001 From: zhangdaiscott Date: Thu, 20 Oct 2022 20:49:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=20issues/I5VXTW=20=E5=B8=A6?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=9A=84=E8=B7=AF=E7=94=B1=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=8F=B3=E4=B8=8A=E8=A7=92=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/web/usePage.ts | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/hooks/web/usePage.ts b/src/hooks/web/usePage.ts index ffe1ebc..d6df000 100644 --- a/src/hooks/web/usePage.ts +++ b/src/hooks/web/usePage.ts @@ -47,8 +47,15 @@ export const useRedo = (_router?: Router) => { return; } if (name && Object.keys(params).length > 0) { - params['_redirect_type'] = 'name'; - params['path'] = String(name); + //update-begin-author:taoyan date:2022-10-19 for: VUEN-2356 【vue3】online表单、表单设计器 功能测试 右键刷新时 404 + if(isDynamicRoute(params, name)){ + params['_redirect_type'] = 'path'; + params['path'] = fullPath; + }else{ + params['_redirect_type'] = 'name'; + params['path'] = String(name); + } + //update-end-author:taoyan date:2022-10-19 for: VUEN-2356 【vue3】online表单、表单设计器 功能测试 右键刷新时 404 } else { params['_redirect_type'] = 'path'; params['path'] = fullPath; @@ -58,3 +65,21 @@ export const useRedo = (_router?: Router) => { } return redo; }; + +/** + * 判断是不是动态路由的跳转 + * @param params + * @param name + */ +function isDynamicRoute(params, name){ + let arr = Object.keys(params); + let flag = false; + for(let i=0;i0){ + flag = true; + break; + } + } + return flag; +}