Browse Source

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

lifanagju_citu 11 tháng trước cách đây
mục cha
commit
f7e519a607
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  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()