feta : 新增实名认证判断 公司/岗位收藏 需要认证

招聘会预约        需要认证
外部岗位申请    需要认证
内部岗位申请    不需要认证
我的页面-认证状态 改为真实数据
This commit is contained in:
2025-12-25 15:09:09 +08:00
parent ff71c50b9c
commit 1b332fbad8
9 changed files with 785 additions and 15 deletions

View File

@@ -2,7 +2,8 @@ import {
defineStore
} from 'pinia';
import {
ref
ref,
inject
} from 'vue'
import {
createRequest
@@ -17,6 +18,7 @@ import {
import {
msg,
$api,
navTo
} from '../common/globalFunction';
import baseDB from '@/utils/db.js';
@@ -61,6 +63,7 @@ const useUserStore = defineStore("user", () => {
const counts = ref({})
const isMiniProgram = ref(false)
const isMachineEnv = ref(false)
const isAuth = ref(false) //是否认证(身份证+手机号)
const login = (value) => {
hasLogin.value = true;
@@ -135,6 +138,19 @@ const useUserStore = defineStore("user", () => {
userInfo.value = values.data;
// role.value = values.role;
hasLogin.value = true;
isAuth.value = values.data?.isCert ?? false
}
const checkAuth = () => {
if (!hasLogin.value) {
logOut()
return false //验证失败
}
if (hasLogin.value && !isAuth.value) {
navTo('/pages/auth/index')
return false //验证失败
}
return true // 验证通过
}
@@ -186,7 +202,9 @@ const useUserStore = defineStore("user", () => {
isMiniProgram,
changMiniProgramAppStatus,
changMachineEnv,
isMachineEnv
isMachineEnv,
isAuth,
checkAuth
}
}, {
unistorage: true,