交易系统前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
485 B

4 years ago
import VueRouter from "vue-router";
import routes from "./routes";
// configure router
const router = new VueRouter({
routes, // short for routes: routes
linkExactActiveClass: "active",
scrollBehavior: to => {
4 years ago
if (to.hash) {
return { selector: to.hash };
4 years ago
} else {
return { x: 0, y: 0 };
4 years ago
}
}
});
router.beforeEach((to, from, next) => {
if (to.meta.auth && !localStorage.getItem("robotToken")) {
} else {
next();
}
});
4 years ago
export default router;