router.js 676 B

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