浏览代码

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

lifanagju_citu 11 月之前
父节点
当前提交
f7e519a607
共有 1 个文件被更改,包括 1 次插入0 次删除
  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()