From 683922e1d29c5b1267dcdaed254d96e4786f6cd1 Mon Sep 17 00:00:00 2001 From: FairyEver <1711467488@qq.com> Date: Thu, 10 Oct 2019 22:11:18 +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: 2dfcd30fcd317b35c12082dbdb18e4efd1b89c6c Former-commit-id: b75f47c82123bade6e829cc570053a205d371d25 Former-commit-id: 27174d6e3468d8dd3df2553cc94642bfcfe72af2 Former-commit-id: 5d3458a1846e2cfa320328d4e9df9cdfabb8feaa [formerly 3ffa1698396a2f9f1a8b8e8ecf639466288d5778] Former-commit-id: 5a6f3197cdaf923b2b7f9e91a5d8b652fc88ceba Former-commit-id: d6d38a45c95ad36c1a46cc829c8b9d284a7f86f2 Former-commit-id: 874017fd9c8f2b05afdde2cc821fde51d0bf2bd0 Former-commit-id: e2b20619a3b46b0df49be992681f99b97b9a9581 Former-commit-id: f2cbb1e2608c920cde2fded57ee5dbe6872a2aed --- .travis.yml | 4 +++- src/router/index.js | 11 ++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9e4803ca..ecdbef72 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,10 +16,12 @@ script: - yarn 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 -o cdn-files.txt + - ./qshell batchdelete --force d2-admin -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 5b49b934..50da5de0 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 里使用