From d2b1a25946078976df05b91a12dbcacc2347ed74 Mon Sep 17 00:00:00 2001 From: FairyEver <1711467488@qq.com> Date: Thu, 10 Oct 2019 22:14:58 +0800 Subject: [PATCH] =?UTF-8?q?fix=20vue-router=20NavigationDuplicated=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20travis=20=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 6f9d375b53e7d91f39a39b18d917635a43e45508 --- .travis.yml | 4 +++- src/router/index.js | 11 ++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bace3b8..a7054a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,10 +13,12 @@ script: - npm run build:travis before_install: - - ./qshell account $AK $SK + - ./qshell account $AK $SK $NAME - curl -o- -L https://yarnpkg.com/install.sh | bash - export PATH=$HOME/.yarn/bin:$PATH after_success: + - ./qshell listbucket d2-admin-start-kit -o cdn-files.txt + - ./qshell batchdelete --force d2-admin-start-kit -i cdn-files.txt - ./qshell qupload qiniu-config - ./qshell cdnrefresh -dirs cdnrefresh-dirs.txt \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 5b49b93..50da5de 100755 --- a/src/router/index.js +++ b/src/router/index.js @@ -6,12 +6,21 @@ import NProgress from 'nprogress' import 'nprogress/nprogress.css' import store from '@/store/index' - import util from '@/libs/util.js' // 路由数据 import routes from './routes' +// fix vue-router NavigationDuplicated +const VueRouterPush = VueRouter.prototype.push +VueRouter.prototype.push = function push (location) { + return VueRouterPush.call(this, location).catch(err => err) +} +const VueRouterReplace = VueRouter.prototype.replace +VueRouter.prototype.replace = function replace (location) { + return VueRouterReplace.call(this, location).catch(err => err) +} + Vue.use(VueRouter) // 导出路由 在 main.js 里使用