|
@@ -290,7 +290,7 @@ Router.prototype.push = function push(location) {
|
|
|
Router.prototype.replace = function push(location) {
|
|
Router.prototype.replace = function push(location) {
|
|
|
return routerReplace.call(this, location).catch((err) => err);
|
|
return routerReplace.call(this, location).catch((err) => err);
|
|
|
};
|
|
};
|
|
|
-// const router =
|
|
|
|
|
|
|
+// const router =
|
|
|
// //路由守卫
|
|
// //路由守卫
|
|
|
// router.beforeEach((to, from, next) => {
|
|
// router.beforeEach((to, from, next) => {
|
|
|
// //路由守卫控制登陆页面取消水印非登录页显示水印
|
|
// //路由守卫控制登陆页面取消水印非登录页显示水印
|
|
@@ -302,8 +302,12 @@ Router.prototype.replace = function push(location) {
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
// });
|
|
// });
|
|
|
-export default new Router({
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+const $router = new Router({
|
|
|
mode: "hash",
|
|
mode: "hash",
|
|
|
scrollBehavior: () => ({ y: 0 }),
|
|
scrollBehavior: () => ({ y: 0 }),
|
|
|
routes: constantRoutes,
|
|
routes: constantRoutes,
|
|
|
});
|
|
});
|
|
|
|
|
+export default $router;
|
|
|
|
|
+
|