|
@@ -25,7 +25,7 @@
|
|
|
</v-btn>
|
|
|
</div>
|
|
|
<div v-show="!showCompanySelect">
|
|
|
- <phoneFrom ref="phoneRef" openVerify @handleEnter="handleClick()" :style="{'width': isMobile ? '100%' : '350px' }"></phoneFrom>
|
|
|
+ <phoneFrom ref="phoneRef" openVerify @verifySuccess="handleConfirmJoin" :style="{'width': isMobile ? '100%' : '350px' }"></phoneFrom>
|
|
|
<v-btn :loading="loginLoading" color="warning" class="white--text mt-3" min-width="350" @click="handleConfirmJoin" :style="{'width': isMobile ? '100%' : '350px' }">
|
|
|
{{ quickRegister ? $t('login.register') : $t('common.confirmJoin') }}
|
|
|
</v-btn>
|
|
@@ -86,16 +86,19 @@ const handleConfirmJoin = async () => {
|
|
|
phoneParams = { ...phoneRef.value.loginData }
|
|
|
const { valid } = await phoneRef.value.phoneForm.validate()
|
|
|
if (!valid) return
|
|
|
+ if (!phoneParams.captchaVerification) {
|
|
|
+ phoneRef.value.getCode(true)
|
|
|
+ return
|
|
|
+ }
|
|
|
loginLoading.value = true
|
|
|
try {
|
|
|
const res = await smsLogin(phoneParams)
|
|
|
setToken(res.accessToken)
|
|
|
setRefreshToken(res.refreshToken)
|
|
|
quickRegister.value ? getApplyInfo() : getEnterpriseList()
|
|
|
- // if (quickRegister.value) getApplyInfo()
|
|
|
- // else getEnterpriseList()
|
|
|
} catch (error) {
|
|
|
- Snackbar.error('查询用户数据失败')
|
|
|
+ phoneRef.value.clearCaptcha()
|
|
|
+ Snackbar.error(error?.msg || error)
|
|
|
} finally {
|
|
|
loginLoading.value = false
|
|
|
}
|
|
@@ -120,7 +123,7 @@ const getEnterpriseList = async() => {
|
|
|
join(data[0].enterpriseId)
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- Snackbar.error('查询用户企业失败')
|
|
|
+ Snackbar.error(error?.msg || error)
|
|
|
logoutFun()
|
|
|
} finally {
|
|
|
loginLoading.value = false
|
|
@@ -149,7 +152,8 @@ const join = async (enterpriseId) => {
|
|
|
Snackbar.success('加入成功')
|
|
|
joinSuccess.value = true
|
|
|
} catch (error) {
|
|
|
- Snackbar.error('加入失败! ' + error)
|
|
|
+ phoneRef.value.clearCaptcha()
|
|
|
+ Snackbar.error(error?.msg || error)
|
|
|
} finally {
|
|
|
loginLoading.value = false
|
|
|
logoutFun()
|