فهرست منبع

Merge branch 'dev' of https://git.citupro.com/zhengnaiwen_citu/menduner into dev

Xiao_123 8 ماه پیش
والد
کامیت
4adbaeea22
2فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 1 1
      src/permission.js
  2. 3 3
      src/utils/auth.js

+ 1 - 1
src/permission.js

@@ -19,7 +19,7 @@ router.beforeEach(async (to, from, next) => {
     useUserStore().checkEnterpriseBaseInfo()
     next()
   }
-  if (getToken(to?.meta?.loginType === 'enterprise' ? 1 : 2)) {
+  if (getToken(to?.meta?.loginType === 'enterprise' ? 1 : 0)) {
     if (to.path === '/login') {
       next({ path: '/recruitHome' })
     } else {

+ 3 - 3
src/utils/auth.js

@@ -10,11 +10,11 @@ const isEnterprise = () => {
 export const getIsEnterprise = () => { isEnterprise() }
 
 // 获取token
-export const getToken = (num) => { // 1:ENT, 2:PER
+export const getToken = (ENT) => {
   const arr = ['ENT_ACCESS_TOKEN', 'PER_ACCESS_TOKEN']
-  let type = isEnterprise() ? arr[0] : arr[1]
+  let type = (ENT || isEnterprise()) ? arr[0] : arr[1]
+  console.log('getToken', type)
   //
-  if (num) type = arr[num-1]
   return localStorage.getItem(type)
 }