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

chore: 增加企业禁用提示

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