permission.ts 532 B

1234567891011121314151617181920212223
  1. import router from "./router";
  2. const whiteList = [
  3. "/check",
  4. ];
  5. router.beforeEach((to, from, next) => {
  6. next();
  7. // 验证 TOKEN
  8. // if (getToken()) {
  9. // /* 登录成功 */
  10. // next();
  11. // } else {
  12. // /* 未登录 */
  13. // if (whiteList.indexOf(to.path) !== -1) {
  14. // // 在免登录白名单,直接进入
  15. // next();
  16. // } else {
  17. // // 否则全部重定向到登录页
  18. // window.location.href = 'http://10.8.11.123:8089/cas/login?service=http://localhost/check'
  19. // }
  20. // }
  21. });