提交 76157cf0 authored 作者: haodaking's avatar haodaking

chore: 增加企业禁用提示

上级 79724b62
......@@ -184,6 +184,8 @@ const rows: Record<string, any>[] = [
}
if (!user.hasCompany) {
ElMessage({ message: '请先注册您的企业' })
} else if (!user.companyEnabled) {
ElMessage({ message: '您的企业已被禁用,请联系我们解禁' })
} else {
window.open('/hr/posts/job')
}
......@@ -231,6 +233,8 @@ const rows: Record<string, any>[] = [
}
if (!user.hasCompany) {
ElMessage({ message: '请先注册您的企业' })
} else if (!user.companyEnabled) {
ElMessage({ message: '您的企业已被禁用,请联系我们解禁' })
} else {
window.open('/project/create')
}
......
......@@ -55,6 +55,8 @@ function onEnable(status: 1 | 2, data: ProjectType) {
function onAdd() {
if (!user.hasCompany) {
ElMessage({ message: '请先注册您的企业' })
} else if (!user.companyEnabled) {
ElMessage({ message: '您的企业已被禁用,请联系我们解禁' })
} else {
router.push('/project/create')
}
......
......@@ -5,6 +5,7 @@ import type { UserState } from '@/types'
interface State {
user: UserState | null
hasCompany: boolean
companyEnabled: boolean
projects: string[]
}
......@@ -13,6 +14,7 @@ export const useUserStore = defineStore({
state: (): State => ({
user: null,
hasCompany: false,
companyEnabled: false,
projects: []
}),
getters: {
......@@ -28,8 +30,8 @@ export const useUserStore = defineStore({
this.user = res.data
if (this.isLogin) {
const { data: alumniUser } = await getAlumniUserInfo()
this.hasCompany =
alumniUser.is_registered_company && alumniUser.company_audit_status === 1 && alumniUser.company_status === 1
this.hasCompany = alumniUser.is_registered_company && alumniUser.company_audit_status === 1
this.companyEnabled = alumniUser.company_status === 1
this.projects = alumniUser.projects
}
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论