马宇豪
2023-11-23 c6144c9892e370edf4dc747cbb327d0924791fe0
src/permission.js
@@ -11,14 +11,14 @@
NProgress.configure({ showSpinner: false });
const whiteList = ['/login'];
const whiteList = ['/homePage'];
router.beforeEach((to, from, next) => {
  NProgress.start()
  if (getToken()) {
    to.meta.title && useSettingsStore().setTitle(to.meta.title)
    /* has token*/
    if (to.path === '/login') {
    if (to.path === '/homePage') {
      next({ path: '/' })
      NProgress.done()
    } else {
@@ -52,7 +52,7 @@
      // 在免登录白名单,直接进入
      next()
    } else {
      next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
      next(`/homePage?redirect=${to.fullPath}`) // 否则全部重定向到登录页
      NProgress.done()
    }
  }