Przeglądaj źródła

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

Xiao_123 10 miesięcy temu
rodzic
commit
2e321d44b1

+ 3 - 3
src/components/Enterprise/details.vue

@@ -74,7 +74,7 @@ import { getEnterpriseDetails, getEnterpriseSubscribeCheck, getEnterpriseSubscri
 import { timesTampChange } from '@/utils/date'
 import { dealDictObjData } from '@/utils/position'
 import { useRoute, useRouter } from 'vue-router'
-import { getPersonalToken } from '@/utils/auth'
+import { getToken } from '@/utils/auth'
 import Snackbar from '@/plugins/snackbar'
 import { useI18n } from '@/hooks/web/useI18n'; const { t } = useI18n()
 
@@ -120,14 +120,14 @@ getDetails()
 // 效验求职者是否关注该企业
 const isCollection = ref(false)
 const getCollectionStatus = async (id) => {
-  if (!getPersonalToken()) return isCollection.value = false
+  if (!getToken()) return isCollection.value = false
   const data = await getEnterpriseSubscribeCheck({ enterpriseId: id })
   isCollection.value = data
 }
 
 // 关注&取消关注企业
 const handleFollow = async () => {
-  if (!getPersonalToken()) return Snackbar.warning(t('resume.changeRolePlease'))
+  if (!getToken()) return Snackbar.warning(t('resume.changeRolePlease'))
   const api = isCollection.value ? getEnterpriseUnsubscribe : getEnterpriseSubscribe
   await api(isCollection.value ? props.id : { enterpriseId: props.id })
   getCollectionStatus(props.id)

+ 3 - 3
src/layout/personal/navBar.vue

@@ -27,7 +27,7 @@
         </div>
         
         <div class="d-flex user-nav">
-          <div class="btns d-flex align-center" v-if="!getPersonalToken()">
+          <div class="btns d-flex align-center" v-if="!getToken()">
             <!-- <span class="nav-resume-tools">
               <a href="">{{ $t('sys.lookingJob') }}</a>
               <a href="">{{ $t('sys.recruit') }}</a>
@@ -36,7 +36,7 @@
           </div>
           
           <!-- 头像用户名 -->
-          <div class="d-flex align-center" v-if="getPersonalToken()">
+          <div class="d-flex align-center" v-if="getToken()">
             <!-- <a target="_blank" href="/mall/purchasePackage" class="cursor-pointer mr-5" style="color: #FB8C00;">{{ $t('vipPackage.purchasePackage') }}</a> -->
             <span class="cursor-pointer" @click="router.push({ path: '/recruit/personal/TaskCenter' })">{{ $t('sys.signIn') }}</span>
             <span class="cursor-pointer mx-5">{{ $t('sys.news') }}</span>
@@ -107,7 +107,7 @@
 
 <script setup>
 import { ref } from 'vue'
-import { getPersonalToken } from '@/utils/auth'
+import { getToken } from '@/utils/auth'
 import { useUserStore } from '@/store/user'
 import { useLocaleStore } from '@/store/locale'
 import { useI18n } from '@/hooks/web/useI18n'

+ 4 - 4
src/permission.js

@@ -35,15 +35,15 @@ router.beforeEach(async (to, from, next) => {
       const type = localStorage.getItem('loginType')
       // 判断企业路由和个人路由,防止互串
       if (!type) { removeToken(); next(`/login?redirect=${to.fullPath}`) }
-      else if (to.meta?.loginType === 'noLogin') next()
-      // 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 === 'common') next()
+      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()
     }
   } else {
-    if (to.meta?.loginType === 'noLogin') { // 页面不需要登录
+    if (to.meta?.loginType === 'noLogin' || to.meta?.loginType === 'common') { // 页面不需要登录
       next()
     } else {
       next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页

+ 1 - 1
src/router/modules/remaining.js

@@ -44,7 +44,7 @@ const remainingRouter = [
   },
 ]
 setLoginType(remainingRouter, 'noLogin')
-setLoginType(common, 'noLogin')
+setLoginType(common, 'common')
 
 const routeArray = [
   ...remainingRouter,

+ 5 - 7
src/views/recruit/personal/position/components/details.vue

@@ -99,7 +99,7 @@
     >
       <div>
         <div class="pa-4" style="background-color: #f0f0f0; border-radius: 8px;">{{ shareUrlTxt }}</div>
-        <v-btn v-if="!getPersonalToken()" class="mt-1" color="warning" variant="text">您还未登录,登录后分享可享受分享有礼活动!</v-btn>
+        <v-btn v-if="!getToken()" class="mt-1" color="warning" variant="text">您还未登录,登录后分享可享受分享有礼活动!</v-btn>
         <v-btn class="mt-4 ml-3" color="success" @click="copyText">复制分享链接</v-btn>
         <v-btn class="mt-4 ml-3" color="primary" variant="outlined" @click="openShareLink">打开分享链接</v-btn>
       </div>
@@ -133,7 +133,7 @@ import Snackbar from '@/plugins/snackbar'
 import Dialog from '@/components/CtDialog'
 import promptToUpload from './jobDetails/promptToUpload'
 import selectResumeDialog from './jobDetails/selectResumeDialog'
-import { getPersonalToken } from '@/utils/auth'
+import { getToken } from '@/utils/auth'
 
 const { t } = useI18n()
 const router = useRouter()
@@ -162,11 +162,10 @@ getPositionDetail()
 
 // 效验是否有投递过简历
 const deliveryCheck = async () => {
-  if (!getPersonalToken()) return delivery.value = false
   const data = await jobCvRelCheckSend({ jobId: id })
   if (data) delivery.value = true
 }
-if (getPersonalToken()) deliveryCheck()
+if (getToken()) deliveryCheck()
 
 const desc = [
   { mdi: 'mdi-map-marker-outline', value: 'areaName' },
@@ -177,7 +176,7 @@ const desc = [
 // 效验求职者是否有收藏该职位
 const isCollection = ref(true)
 const getCollectionStatus = async () => {
-  if (!getPersonalToken()) return isCollection.value = false
+  if (!getToken()) return isCollection.value = false
   const data = await getJobFavoriteCheck({ jobId: id })
   isCollection.value = data
 }
@@ -235,7 +234,7 @@ const copyText = async () => {
 
 // 收藏&取消收藏职位
 const handleCollection = async () => {
-  if (!getPersonalToken()) return Snackbar.warning(t('resume.changeRolePlease'))
+  if (!getToken()) return Snackbar.warning(t('resume.changeRolePlease'))
   const api = isCollection.value ? getPersonJobUnfavorite : getPersonJobFavorite
   await api(isCollection.value ? id : { jobId: id })
   await getCollectionStatus()
@@ -253,7 +252,6 @@ const handleToUpload = () => {
 const resumeList = ref([])
 const selectResume = ref()
 const handleDelivery = async () => {
-  if (!getPersonalToken()) return Snackbar.warning(t('resume.changeRolePlease'))
   if (delivery.value) return Snackbar.warning(t('resume.alreadyResume'))
   const result = await getPersonResumeCv()
   resumeList.value = result