Bladeren bron

Merge branch 'dev' of https://git.citupro.com/zhengnaiwen_citu/menduner into dev

Xiao_123 6 maanden geleden
bovenliggende
commit
38ccfd2523

+ 3 - 2
src/api/recruit/enterprise/enterpriseInvite.js

@@ -24,9 +24,10 @@ export const enterpriseInviteRefresh = async (code) => {
 }
 
 // 同意加入
-export const enterpriseInviteRecordConsent = async (code) => {
+export const enterpriseInviteRecordConsent = async (params) => {
   return await request.post({
-    url: `/app-api/menduner/system/recruit/enterprise-invite-record/consent?code=${code}`
+    url: '/app-api/menduner/system/recruit/enterprise-invite-record/consent',
+    params
   })
 }
 

+ 3 - 2
src/components/VerificationCode/index.vue

@@ -173,14 +173,15 @@ const handleEnter = () => {
   emits('handleEnter')
 }
 
-const resetPhone = () => {
+const resetForm = () => {
+  loginData.email = ''
   loginData.phone = ''
   loginData.code = ''
   count.value = 0
 }
 
 defineExpose({
-  resetPhone, 
+  resetForm, 
   loginData, 
   phoneForm
 })

+ 1 - 4
src/layout/personal/navBar.vue

@@ -223,14 +223,11 @@ const handleSwitch = async () => {
 
 // 切换提交
 const switchSubmit = async () => {
-  // await logout() // 先退出个人登录
   localStorage.setItem('enterpriseId', radios.value)
+  localStorage.setItem('emailLoginInfo', "false") // 先清空企业邮箱信息,避免求职切换招聘有邮箱登录信息遗留导致使用邮箱信息
 
   // 跳转企业路由 且验证是否已完善必填基本信息
   window.location.href = '/enterpriseVerification'
-
-  // 获取企业账号令牌以及企业用户个人信息
-  // await userStore.changeRole(radios.value)
 }
 
 const btnType = ref(0)

+ 2 - 4
src/store/user.js

@@ -155,8 +155,6 @@ export const useUserStore = defineStore('user',
         if (res?.type === 'emailLogin') {
           data = res
         } else {
-          // 先退出个人登录
-          // await logout()
           const enterpriseId = localStorage.getItem('enterpriseId') || ''
           if (!enterpriseId) return Snackbar.error('切换失败,请重新登录!')
           data = await switchLoginOfEnterprise({ enterpriseId })
@@ -235,8 +233,8 @@ export const useUserStore = defineStore('user',
       // 检查密码是否需要修改
       async updatePasswordCheck () {
         const bool = await getEntUpdatePasswordCheck()
-        if (bool) {
-          localStorage.setItem('entUpdatePassword', bool ? 'needChange' : 'doNotNeedChange')
+        if (!bool) {
+          localStorage.setItem('entUpdatePassword', !bool ? 'needChange' : 'doNotNeedChange')
         }
       }
     }

+ 11 - 1
src/views/recruit/enterprise/staffChangePassword/index.vue

@@ -7,7 +7,9 @@
     <CtForm ref="CtFormRef" :items="formItems" style="width: 700px;"></CtForm>
     <div class="mb-15">
       <v-btn class="buttons mt-5" color="primary" :loading="loading" @click.stop="handleCommit">保存</v-btn>
-      <v-btn v-if="!props.hideGoBack" class="mt-3" color="primary" variant="text" @click="router.go(-1)">返回</v-btn>
+      <div v-if="!props.hideGoBack" style="text-align: center;">
+        <v-btn class="mt-3" color="primary" variant="text" @click="router.go(-1)">返回</v-btn>
+      </div>
     </div>
   </v-card>
 
@@ -59,6 +61,10 @@ const formItems = ref({
         value => {
           if (!(/^[\s]+$/.test(value))) return true
           return '请输入新密码'
+        },
+        value => {
+          if (/^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,16}$/.test(value)) return true
+          return '请输入8-16位数由数字、大小写字母组成的密码'
         }
       ]
     },
@@ -75,6 +81,10 @@ const formItems = ref({
         value => {
           if (!(/^[\s]+$/.test(value))) return true
           return '请再次输入新密码'
+        },
+        value => {
+          if (/^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,16}$/.test(value)) return true
+          return '请输入8-16位数由数字、大小写字母组成的密码'
         }
       ]
     },

+ 11 - 3
src/views/recruit/enterprise/systemManagement/groupAccount/inviteConfirm.vue

@@ -14,7 +14,12 @@
       </div>
       <div class="mt-10 d-flex flex-column align-center">
         <template v-if="joinSuccess">
-          <div>加入成功!</div>
+          <div style="color: var(--v-primary-base); font-size: 18px; font-weight: bold;">加入成功!</div>
+          <!-- <div class="mt-3">您使用企业邮箱登录招聘端的初始密码为"邮箱账号",请尽快登录招聘端修改密码!</div> -->
+          <div class="mt-3">您使用企业邮箱登录招聘端的初始密码</div>
+          <div class="mt-2">为 <span style="color: var(--v-error-base);">"{{ joinPersonEmail }}"</span></div>
+          <div class="mt-2" style="color: var(--v-error-base);">请尽快登录招聘企业修改密码!</div>
+          <!-- <div class="mt-3">您使用企业邮箱登录招聘端的初始密码为"邮箱账号",请尽快登录招聘端修改密码!</div> -->
           <v-btn v-if="!isMobile" class="mt-10" color="warning" to="/recruitHome">{{ $t('common.toHome') }}</v-btn>
         </template>
         <template v-else>
@@ -67,6 +72,7 @@ onMounted(() => {
 const phoneRef = ref()
 const loginLoading = ref(false)
 
+let joinPersonEmail = ''
 let copyLoginData = ''
 let userId = ''
 // 登录
@@ -76,6 +82,7 @@ const handleLogin = async () => {
   loginLoading.value = true
   try {
     const params = { ...phoneRef.value.loginData, autoRegister: true } // 只能验证码登录
+    joinPersonEmail = params.email || ''
     // 如果用户登录后点击关闭填写简易人才信息,再次点击登录仅弹出填写,不再调用登录
     if (copyLoginData === (params.phone + params.code.toString()) && userId) {
       getUserBaseInfos(userId)
@@ -123,12 +130,13 @@ const getUserBaseInfos = async (userId) => {
 const join = async () => {
   loginLoading.value = true
   try {
-    await enterpriseInviteRecordConsent(code)
+    const params = { code, email: joinPersonEmail }
+    await enterpriseInviteRecordConsent(params)
     joinSuccess.value = true
     Snackbar.success('加入成功')
   } catch (error) {
     Snackbar.error('加入失败! ' + error + '请更换手机号')
-    if (phoneRef.value?.resetPhone) phoneRef.value.resetPhone()
+    if (phoneRef.value?.resetPhone) phoneRef.value.resetForm()
   } finally {
     if (isMobile.value) logoutFun() // 网页打开保留登录状态
     loginLoading.value = false