From eff06c110f49db6c9632b53deb5ea4b6a926d4b2 Mon Sep 17 00:00:00 2001 From: loren-li Date: Thu, 20 Apr 2023 15:02:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B7=AF=E7=94=B1=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E8=A2=AB=E9=98=BB=E6=AD=A2=E6=97=B6vue-router?= =?UTF-8?q?=E5=86=85=E9=83=A8=E4=BA=A7=E7=94=9F=E6=8A=A5=E9=94=99=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/router/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index b370bdd92..71907b696 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -166,9 +166,15 @@ export const dynamicRoutes = [ // 防止连续点击多次路由报错 let routerPush = Router.prototype.push; +let routerReplace = Router.prototype.replace; +// push Router.prototype.push = function push(location) { return routerPush.call(this, location).catch(err => err) } +// replace +Router.prototype.replace = function push(location) { + return routerReplace.call(this, location).catch(err => err) +} export default new Router({ mode: 'history', // 去掉url中的#