fix:修复重复点击导航路由报错

This commit is contained in:
wenyann 2020-09-30 14:07:09 +08:00
parent 81d64b5932
commit a66741406f
2 changed files with 9 additions and 2 deletions

View File

@ -7,15 +7,15 @@
</slot> </slot>
</el-row> </el-row>
<el-row type="flex" justify="space-between" align="middle"> <el-row type="flex" justify="space-between" align="middle">
<template v-slot:button>
<span class="operate-button"> <span class="operate-button">
<ms-table-button :is-tester-permission="isTesterPermission" v-if="showCreate" icon="el-icon-circle-plus-outline" <ms-table-button :is-tester-permission="isTesterPermission" v-if="showCreate" icon="el-icon-circle-plus-outline"
:content="createTip" @click="create"/> :content="createTip" @click="create"/>
<ms-table-button :is-tester-permission="isTesterPermission" v-if="showRun" icon="el-icon-video-play" <ms-table-button :is-tester-permission="isTesterPermission" v-if="showRun" icon="el-icon-video-play"
type="primary" type="primary"
:content="runTip" @click="runTest"/> :content="runTip" @click="runTest"/>
<slot name="button"></slot>
</span> </span>
</template>
<span> <span>
<ms-table-search-bar :condition.sync="condition" @change="search" class="search-bar" :tip="tip"/> <ms-table-search-bar :condition.sync="condition" @change="search" class="search-bar" :tip="tip"/>
<ms-table-adv-search-bar :condition.sync="condition" @search="search" v-if="isCombine"/> <ms-table-adv-search-bar :condition.sync="condition" @search="search" v-if="isCombine"/>

View File

@ -41,6 +41,13 @@ router.beforeEach((to, from, next) => {
} }
}); });
//重复点击导航路由报错
const routerPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
return routerPush.call(this, location).catch(error => error)
}
// 登入后跳转至原路径 // 登入后跳转至原路径
function redirectLoginPath(originPath) { function redirectLoginPath(originPath) {
let redirectUrl = sessionStorage.getItem('redirectUrl'); let redirectUrl = sessionStorage.getItem('redirectUrl');