From 9f44ccfbf05ef72ed02c0a05388701f776e54dcd Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Fri, 15 Oct 2021 16:15:59 +0800 Subject: [PATCH] Fix redirect issue --- src/router/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 9e59941d..568b8263 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -333,10 +333,12 @@ router.beforeEach((to, from, next) => { // const has = Object.keys(config).findIndex(i => i === c) if (!config || Object.keys(config).findIndex(i => i === c) > -1) { next() - } if (c === 'index.php') { - next({ name: 'home' }) } else if (c) { - next({ name: 'chain-404' }) + if (c === 'index.php') { + next({ name: '/' }) + } else { + next({ name: 'chain-404' }) + } } else { next() }