|
@@ -51,7 +51,7 @@ defineOptions({ name: 'inviteConfirm'})
|
|
|
import { ref, onMounted } from 'vue'
|
|
|
import phoneFrom from '@/components/VerificationCode'
|
|
|
import { useRoute } from 'vue-router'; const route = useRoute()
|
|
|
-import { enterpriseInviteRecordConsent, getEnterpriseInfoByCode } from '@/api/recruit/enterprise/enterpriseInvite.js'
|
|
|
+import { enterpriseInvitePersonRecordConsent, getEnterpriseInfoByCode } from '@/api/recruit/enterprise/enterpriseInvite.js'
|
|
|
import Snackbar from '@/plugins/snackbar'
|
|
|
import { getToken } from '@/utils/auth'
|
|
|
import { logout } from '@/api/common'
|
|
@@ -94,15 +94,17 @@ const handleLogin = async () => {
|
|
|
dialogExtend('necessaryInfoDialog', { setInfo }).then(() => {
|
|
|
join()
|
|
|
})
|
|
|
- return
|
|
|
} else {
|
|
|
join()
|
|
|
}
|
|
|
+ return
|
|
|
}
|
|
|
if (!params.captchaVerification) {
|
|
|
phoneRef.value.getCode(true)
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ await logoutFun() // 登录前清楚个人信息
|
|
|
const data = await useUserStore().handleSmsLogin(params)
|
|
|
copyLoginData = params.phone + params.code.toString()
|
|
|
userId = data.userId
|
|
@@ -123,37 +125,12 @@ const handleLogin = async () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// 查询人才信息
|
|
|
-// const showSimpleInput = ref(false)
|
|
|
-// const getUserBaseInfos = async (userId) => {
|
|
|
-// loginLoading.value = true
|
|
|
-// try {
|
|
|
-// const data = await getBaseInfo({ userId })
|
|
|
-// if (!data) {
|
|
|
-// showSimpleInput.value = true; Snackbar.warning('请先完善个人基本信息')
|
|
|
-// return
|
|
|
-// }
|
|
|
-// const keyArr = ['name', 'phone', 'jobStatus', 'expType', 'eduType'] // 必填人才信息
|
|
|
-// const simpleInfoReady = Object.keys(data).length && keyArr.every(e => data[e] && data[e] !== 0) // 校验必填人才信息
|
|
|
-// if (!simpleInfoReady) {
|
|
|
-// showSimpleInput.value = true; Snackbar.warning('请先完善个人基本信息')
|
|
|
-// return
|
|
|
-// }
|
|
|
-// join()
|
|
|
-// } catch (error) {
|
|
|
-// logoutFun()
|
|
|
-// Snackbar.error('获取用户信息失败! ' + error)
|
|
|
-// } finally {
|
|
|
-// loginLoading.value = false
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
// 调用加入接口
|
|
|
const join = async () => {
|
|
|
loginLoading.value = true
|
|
|
try {
|
|
|
const params = { code, email: joinPersonEmail }
|
|
|
- await enterpriseInviteRecordConsent(params)
|
|
|
+ await enterpriseInvitePersonRecordConsent(params)
|
|
|
joinSuccess.value = true
|
|
|
Snackbar.success('加入成功')
|
|
|
} catch (error) {
|
|
@@ -168,7 +145,7 @@ const join = async () => {
|
|
|
}
|
|
|
|
|
|
const logoutFun = async () => {
|
|
|
- if (!getToken(1)) {
|
|
|
+ if (!getToken(2)) { // 没有求职者token
|
|
|
localStorage.clear()
|
|
|
return
|
|
|
}
|
|
@@ -181,21 +158,6 @@ const logoutFun = async () => {
|
|
|
}
|
|
|
// logoutFun() // 清除之前的token
|
|
|
|
|
|
-// 提交简易人才信息
|
|
|
-// const formRef = ref()
|
|
|
-// const simpleInfoSubmit = async () => {
|
|
|
-// try {
|
|
|
-// const obj = await formRef.value.getQuery()
|
|
|
-// if (!obj) return
|
|
|
-// await savePersonSimpleInfo(obj)
|
|
|
-// join()
|
|
|
-// if (!isMobile.value) await useUserStore().getUserBaseInfos() // 网页打开需更新用户信息
|
|
|
-// // showSimpleInput.value = false
|
|
|
-// } catch (error) {
|
|
|
-// console.error('error', error)
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
const enterpriseInfo = ref({})
|
|
|
// 根据邀请码获取企业信息
|
|
|
const getEnterpriseInfo = async () => {
|