소스 검색

企业信息设置未完善

lifanagju_citu 8 달 전
부모
커밋
04f0c5592b
2개의 변경된 파일16개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      src/layout/personal/navBar.vue
  2. 10 0
      src/store/user.js

+ 6 - 1
src/layout/personal/navBar.vue

@@ -191,13 +191,18 @@ const changeLoginType = async () => {
   }
   else getApplyInfo()
 }
+
+import Snackbar from '@/plugins/snackbar'
 // 切换为招聘者
 const toEnterprise = async (enterpriseId) => {
   await getUserBindEnterpriseList({ enterpriseId })
   // 获取企业账号令牌以及企业用户个人信息
   await userStore.changeRole(enterpriseId)
+  const check = await userStore.checkEnterpriseBaseInfo()
   // router.push({ path: '/recruit/enterprise' })
-  window.location.href = '/recruit/enterprise'
+  const href = check ? '/recruit/enterprise' : '/recruit/enterprise/informationManagement/informationSettings'
+  Snackbar.info('企业信息设置未完善!')
+  window.location.href = href
 }
 
 // 查看用户是否有在申请中的数据

+ 10 - 0
src/store/user.js

@@ -13,10 +13,12 @@ import {
 } from '@/api/common'
 import { getUserInfo } from '@/api/personal/user'
 import { getEnterpriseUserAccount, getAccountBalance, getUserAccount } from '@/api/common'
+import { getEnterpriseBaseInfo } from '@/api/enterprise'
 import Snackbar from '@/plugins/snackbar'
 import { timesTampChange } from '@/utils/date'
 import { updateEventList } from '@/utils/eventList'
 import { getBaseInfoDictOfName } from '@/utils/getText'
+
 // import { useIMStore } from './im'
 
 // const useIM = useIMStore()
@@ -158,6 +160,14 @@ export const useUserStore = defineStore('user',
         localStorage.setItem('enterpriseUserAccount', JSON.stringify(data))
         return data // 方便直接获取
       },
+      // 获取《企业基本信息》
+      async checkEnterpriseBaseInfo () {
+        const data = await getEnterpriseBaseInfo()
+        const keyArr = ['industryId', 'financingStatus', 'scale', 'introduce', 'logoUrl'] // 必填信息
+        const check = Object.keys(data).length && keyArr.every(e => data[e] && data[e] !== 0) // 校验必填人才信息
+        return check
+      },
+
       // 获取用户账户信息
       async getUserAccountInfo () {
         const data = await getUserAccount()