|
@@ -1,7 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<div class="login-box pb-5">
|
|
<div class="login-box pb-5">
|
|
<div :class="isMobile? 'mobileBox' : 'default-width'">
|
|
<div :class="isMobile? 'mobileBox' : 'default-width'">
|
|
- <v-btn v-if="btnType === 1" class="my-2" color="black" variant="text" size="large" @click="router.go(-1)">{{ `<< 返回` }}</v-btn>
|
|
|
|
|
|
+ <v-btn v-if="pageType === 1" class="my-2" color="black" variant="text" size="large" @click="router.go(-1)">{{ `<< 返回` }}</v-btn>
|
|
<v-btn v-else class="my-2" color="primary" variant="text" size="large" @click="router.push('/recruitHome')">{{ `<< 回到首页` }}</v-btn>
|
|
<v-btn v-else class="my-2" color="primary" variant="text" size="large" @click="router.push('/recruitHome')">{{ `<< 回到首页` }}</v-btn>
|
|
</div>
|
|
</div>
|
|
<v-card class="pa-5" :class="isMobile? 'mobileBox' : 'default-width'" :elevation="isMobile? '0' : '3'">
|
|
<v-card class="pa-5" :class="isMobile? 'mobileBox' : 'default-width'" :elevation="isMobile? '0' : '3'">
|
|
@@ -82,7 +82,7 @@ onMounted(() => {
|
|
|
|
|
|
|
|
|
|
import { useRoute } from 'vue-router'; const route = useRoute()
|
|
import { useRoute } from 'vue-router'; const route = useRoute()
|
|
-const btnType = route?.query?.type === 'login' ? 1 : 0
|
|
|
|
|
|
+const pageType = route?.query?.type || '' // type: noLoginToRegister:->登录页注册企业
|
|
|
|
|
|
// 是否筹建中
|
|
// 是否筹建中
|
|
const isPrepare = ref(false)
|
|
const isPrepare = ref(false)
|
|
@@ -176,6 +176,10 @@ const formItems = ref({
|
|
// 上传
|
|
// 上传
|
|
let licenseUrl = ref('')
|
|
let licenseUrl = ref('')
|
|
|
|
|
|
|
|
+const isOnlySpaces = (str) => {
|
|
|
|
+ return /^[\s]+$/.test(str) ? null : str // 判断是否只有空格
|
|
|
|
+}
|
|
|
|
+
|
|
// 提交 企业注册
|
|
// 提交 企业注册
|
|
const handleCommit = async () => {
|
|
const handleCommit = async () => {
|
|
const { valid } = await CtFormRef.value.formRef.validate()
|
|
const { valid } = await CtFormRef.value.formRef.validate()
|
|
@@ -189,24 +193,10 @@ const handleCommit = async () => {
|
|
}
|
|
}
|
|
formItems.value.options.forEach(e => { params[e.key] = e.value })
|
|
formItems.value.options.forEach(e => { params[e.key] = e.value })
|
|
// 邮箱登录密码校验
|
|
// 邮箱登录密码校验
|
|
- if (params.password && !params.passwordConfirm) return Snackbar.warning('请输入确认邮箱登录密码')
|
|
|
|
- // if (params.password && !params.passwordConfirm) {
|
|
|
|
- // const item = formItems.value.options.find(e => e.key == 'password')
|
|
|
|
- // if (item) item.rules = [v => !!v || '请输入确认邮箱登录密码']
|
|
|
|
- // Snackbar.warning('请输入确认邮箱登录密码')
|
|
|
|
- // return
|
|
|
|
- // }
|
|
|
|
- if (params.passwordConfirm && !params.password) return Snackbar.warning('请输入邮箱登录密码')
|
|
|
|
- if (params.passwordConfirm !== params.password) return Snackbar.warning('两次输入的邮箱登录密码不一致,请确认输入内容')
|
|
|
|
-
|
|
|
|
- if (params.passwordConfirm !== params.password) {
|
|
|
|
- const password = formItems.value.options.find(e => e.key == 'password')
|
|
|
|
- if (password) password.rules = [true]
|
|
|
|
- // const passwordConfirm = formItems.value.options.find(e => e.key == 'password')
|
|
|
|
- // if (passwordConfirm) passwordConfirm.rules = [v => !!v || '请输入确认邮箱登录密码']
|
|
|
|
- Snackbar.warning('请输入确认邮箱登录密码')
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
|
|
+ const pa1 = isOnlySpaces(params.password); const pa2 = isOnlySpaces(params.passwordConfirm);
|
|
|
|
+ if (pa1 && !pa2) return Snackbar.warning('请输入确认邮箱登录密码')
|
|
|
|
+ if (!pa1 && pa2) return Snackbar.warning('请输入邮箱登录密码')
|
|
|
|
+ if (pa1 !== pa2) return Snackbar.warning('两次输入的邮箱登录密码不一致,请确认输入内容')
|
|
|
|
|
|
await enterpriseRegisterApply(params)
|
|
await enterpriseRegisterApply(params)
|
|
Snackbar.success(t('common.submittedSuccessfully'))
|
|
Snackbar.success(t('common.submittedSuccessfully'))
|