Sfoglia il codice sorgente

修改路由拦截跳转的界面

pm 1 anno fa
parent
commit
8f525fe974
1 ha cambiato i file con 2 aggiunte e 21 eliminazioni
  1. 2 21
      src/router/index.js

+ 2 - 21
src/router/index.js

@@ -345,30 +345,11 @@ Router.prototype.push = function push(location) {
   return routerPush.call(this, location).catch(err => err)
 }
 
-// export default new Router({
-//   mode: 'history', // 去掉url中的#
-//   scrollBehavior: () => ({ y: 0 }),
-//   routes: constantRoutes
-// })
-
-
-// 导出 Router 实例
-const router = new Router({
+export default new Router({
   mode: 'history', // 去掉url中的#
   scrollBehavior: () => ({ y: 0 }),
   routes: constantRoutes
-});
-
-// 导航守卫
-router.beforeEach((to, from, next) => {
-  if (to.path === '/tool/build') {
-    // 重定向到另一个项目的 URL
-    window.location.href = 'http://localhost:8080/';
-  } else {
-    next();
-  }
-});
+})
 
 
 
-export default router;