Explorar o código

无需登录也能访问的页面(personal里面的一种特殊类型,企业相关路由都需要登录)

lifanagju_citu hai 11 meses
pai
achega
f7e519a607
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      src/permission.js

+ 1 - 0
src/permission.js

@@ -35,6 +35,7 @@ router.beforeEach(async (to, from, next) => {
       // 判断企业路由和个人路由,防止互串
       if (!type) { removeToken(); next(`/login?redirect=${to.fullPath}`) }
       else if (type === 'enterprise' && to.meta?.loginType === 'noLogin') next({ path: `/${type}` })
+      else if (type === 'personal' && to.meta?.loginType === 'noLogin') next()
       else if (to.meta?.loginType === type) next()
       else next({ path: `/${type}` })
       // next()