Selaa lähdekoodia

登陆后查询是否存在简易基本信息

lifanagju_citu 10 kuukautta sitten
vanhempi
commit
80720df24c

+ 7 - 1
src/components/CtDialog/index.vue

@@ -15,6 +15,7 @@
         <span class="d-flex align-center justify-space-between" :class="[props.titleClass]">
           {{ props.title }}
           <v-btn
+            v-if="props.closeable"
             icon
             elevation="0"
             @click="handleClose"
@@ -34,6 +35,7 @@
         <v-card-actions>
           <v-spacer></v-spacer>
           <v-btn
+            v-if="props.closeable"
             color="primary"
             text
             @click="handleClose"
@@ -97,7 +99,11 @@ const props = defineProps({
   flexBox: {
     type: Boolean,
     default: false
-  }
+  },
+  closeable: {
+    type: Boolean,
+    default: true
+  },
 })
 
 const show = ref(false)

+ 2 - 3
src/store/user.js

@@ -24,7 +24,7 @@ import { getChatKey } from '@/api/common'
 export const useUserStore = defineStore('user',
   {
     state: () => ({
-      loginType: 'personal', // 登录类型 // 330为企业登录
+      // loginType: null, // 登录类型 // 330为企业登录
       accountInfo: localStorage.getItem('accountInfo') ? JSON.parse(localStorage.getItem('accountInfo')) : {}, // 登录返回的信息
       userInfo: localStorage.getItem('userInfo') ? JSON.parse(localStorage.getItem('userInfo')) : {}, // 当前登录账号信息
       baseInfo: localStorage.getItem('baseInfo') ? JSON.parse(localStorage.getItem('baseInfo')) : {}, // 人才信息
@@ -102,8 +102,7 @@ export const useUserStore = defineStore('user',
           const api = this.loginType ? null : getBaseInfo
           if (!api) return
           const data = await api({ userId: userId || this.accountInfo.userId })
-          // if (!data) return localStorage.setItem('baseInfo', JSON.stringify('{}'))
-          if (!data) return
+          if (!data) return localStorage.setItem('baseInfo', '{}')
           this.baseInfo = await this.getFieldText(data)
           localStorage.setItem('baseInfo', JSON.stringify(this.baseInfo))
         } catch (error) {

+ 3 - 0
src/views/recruit/personal/home/index.vue

@@ -13,10 +13,13 @@
       <PopularEnterprises class="mt-10"></PopularEnterprises>
     </div>
   </div>
+  <!-- 快速填写简易人才信息-弹窗 -->
+  <simplePage :closeable="false"></simplePage>
 </template>
 
 <script setup>
 defineOptions({ name:'personal-index'})
+import simplePage from '@/views/recruit/personal/shareJob/sendResume/simple.vue'
 import headCarousel from './components/headCarousel.vue'
 import headSearch from '@/components/headSearch'
 import hotJobs from './components/hotJobs.vue'

+ 1 - 1
src/views/recruit/personal/remuse/components/basicInfo.vue

@@ -136,7 +136,7 @@ const welfareList = ref(['响应', '改变', '诚信', '进取精神', '信任',
 let baseInfo = ref({})
 const getBasicInfo = () => { // 获取基础信息
   const key = localStorage.getItem('baseInfo')
-  if (!key) return
+  if (!key || !Object.keys(key).length) return
   baseInfo.value = JSON.parse(key) // 人才信息
 }
 getBasicInfo()

+ 2 - 2
src/views/recruit/personal/remuse/components/selfEvaluation.vue

@@ -41,8 +41,8 @@ const useStore = useUserStore()
 const getData = async () => {
   await useStore.getUserBaseInfos(JSON.parse(localStorage.getItem('userInfo')).id)
   const baseInfo = JSON.parse(localStorage.getItem('baseInfo'))
-  if (!baseInfo) return
-  advantage.value = baseInfo.advantage
+  // if (!baseInfo) return
+  advantage.value = baseInfo?.advantage || ''
 }
 getData()
 

+ 13 - 1
src/views/recruit/personal/shareJob/sendResume/simple.vue

@@ -5,7 +5,8 @@
     :widthType="2"
     titleClass="text-h6"
     title="补充基本信息"
-    @close="openDialog = false"
+    :closeable="props.closeable"
+    @close="openDialog = props.closeable ? false : true"
     @submit="simpleInfoSubmit"
   >
     <simpleInfoForm ref="formRef"></simpleInfoForm>
@@ -13,6 +14,7 @@
 </template>
 
 <script setup>
+import { getToken } from '@/utils/auth'
 import simpleInfoForm from '../form/simpleInfo.vue'
 import { savePersonSimpleInfo } from '@/api/recruit/personal/shareJob'
 import { useI18n } from '@/hooks/web/useI18n'; const { t } = useI18n()
@@ -20,6 +22,12 @@ import Snackbar from '@/plugins/snackbar'
 import { ref } from 'vue'
 defineOptions({name: 'shareJob-sendResume-simple'})
 const emit = defineEmits(['simpleInfoReady'])
+const props = defineProps({
+  closeable: {
+    type: Boolean,
+    default: true
+  }
+})
 
 const openDialog = ref(false) // 默认不打开弹窗,先检验simpleInfoReady
 const info = ref(null)
@@ -32,6 +40,10 @@ setTimeout(() => { if (!info.value) getUserInfoFail() }, 10000);
 
 // 查询用户基本信息
 const getUserInfoVerify = () => {
+  if (!getToken()) {
+    clearInterval(timer.value); timer.value = null
+    return
+  }
   if (info.value) {
     if (timer.value) clearInterval(timer.value); timer.value = null
     const keyArr = ['name', 'phone', 'jobStatus', 'expType', 'eduType'] // 必填人才信息