|
|
@@ -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;
|