router.js 752 B

1234567891011121314151617181920212223242526272829
  1. import Vue from "vue";
  2. import Router from "vue-router";
  3. import PortalRoutes from "./modules/portal/routes/routes";
  4. import MarklRoutes from "./modules/marking/routes/routes";
  5. Vue.use(Router);
  6. let router = new Router({
  7. mode: "history",
  8. routes: [...PortalRoutes,...MarklRoutes]
  9. });
  10. // router.beforeEach((to, from, next) => {
  11. // const loginPath = "/login/" + localStorage.getItem("domain");
  12. // if (to.path.match(/^\/login\/.+$/)) {
  13. // next();
  14. // } else {
  15. // if (!window.sessionStorage.getItem("token")) {
  16. // if (!localStorage.getItem("domain")) {
  17. // alert("地址出错,找不到机构!");
  18. // }
  19. // next({ path: loginPath });
  20. // } else {
  21. // next();
  22. // }
  23. // }
  24. // });
  25. export default router;