guhongwei 4 лет назад
Родитель
Сommit
1abe5efd24
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      src/router/index.js

+ 4 - 0
src/router/index.js

@@ -1,6 +1,10 @@
 import Vue from 'vue';
 import VueRouter from 'vue-router';
 import store from '@/store/index';
+const originalPush = VueRouter.prototype.push;
+VueRouter.prototype.push = function push(location) {
+  return originalPush.call(this, location).catch(err => err);
+};
 const jwt = require('jsonwebtoken');
 const list = [
   {