不允许从当前路由跳转到当前路由

    1. import VueRouter from "vue-router";
    2. const originalPush = VueRouter.prototype.push
    3. VueRouter.prototype.push = function push(location) {
    4. return originalPush.call(this, location).catch(err => err)
    5. }