登录注册更改
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
const router = useRouter()
|
||||
const globalStore = useGlobalStore()
|
||||
const loading = computed(() => globalStore.state.loading || globalStore.state.view_loading)
|
||||
globalStore.setLoading(false)
|
||||
window['onClickPrivacy'] = () => {
|
||||
// window.event?.preventDefault()
|
||||
console.log('onClickPrivacy')
|
||||
@@ -28,7 +29,7 @@
|
||||
#app {
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
.el-message{
|
||||
.el-message {
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
#loading {
|
||||
|
||||
@@ -48,7 +48,12 @@
|
||||
</el-form>
|
||||
<div class="tip-2" v-html="$t('Login.noAccountToSignUp')"></div>
|
||||
</template>
|
||||
<visible-code v-else :email="formData.email" @submit="onVerifyCode" />
|
||||
<visible-code
|
||||
v-show="isVisible"
|
||||
ref="visibleCodeRef"
|
||||
:email="formData.email"
|
||||
@submit="onVerifyCode"
|
||||
/>
|
||||
<other-login />
|
||||
</div>
|
||||
</div>
|
||||
@@ -84,11 +89,14 @@
|
||||
router.back()
|
||||
}
|
||||
}
|
||||
const visibleCodeRef = ref(null)
|
||||
const onSubmit = () => {
|
||||
formRef.value?.validate?.((valid) => {
|
||||
if (valid) {
|
||||
// console.log('submit!')
|
||||
isVisible.value = true
|
||||
visibleCodeRef.value?.onSendCode().then(() => {
|
||||
isVisible.value = true
|
||||
})
|
||||
} else {
|
||||
console.warn('error submit!')
|
||||
}
|
||||
|
||||
@@ -52,7 +52,12 @@
|
||||
</el-form>
|
||||
<div class="tip-2" v-html="$t('Login.havenAccountToLogin')"></div>
|
||||
</template>
|
||||
<visible-code v-else :email="formData.email" @submit="onVerifyCode" />
|
||||
<visible-code
|
||||
v-show="isVisible"
|
||||
ref="visibleCodeRef"
|
||||
:email="formData.email"
|
||||
@submit="onVerifyCode"
|
||||
/>
|
||||
<other-login />
|
||||
</div>
|
||||
</div>
|
||||
@@ -90,11 +95,14 @@
|
||||
router.back()
|
||||
}
|
||||
}
|
||||
const visibleCodeRef = ref(null)
|
||||
const onSubmit = () => {
|
||||
formRef.value?.validate?.((valid) => {
|
||||
if (valid) {
|
||||
// console.log('submit!')
|
||||
isVisible.value = true
|
||||
visibleCodeRef.value?.onSendCode().then(() => {
|
||||
isVisible.value = true
|
||||
})
|
||||
} else {
|
||||
console.warn('error submit!')
|
||||
}
|
||||
|
||||
@@ -45,16 +45,17 @@
|
||||
clearTime()
|
||||
})
|
||||
onMounted(() => {
|
||||
onSendCode()
|
||||
// onSendCode()
|
||||
})
|
||||
const onSendCode = async () => {
|
||||
const email = props.email
|
||||
if (!email) {
|
||||
console.warn('请输入邮箱')
|
||||
return
|
||||
return Promise.reject('请输入邮箱')
|
||||
}
|
||||
setTime()
|
||||
await SendVerificationCode({ email })
|
||||
setTime()
|
||||
return Promise.resolve()
|
||||
}
|
||||
const onResend = () => {
|
||||
if (time.value > 0) return
|
||||
@@ -64,6 +65,9 @@
|
||||
if (code.value.length !== 6) return
|
||||
emit('submit', code.value)
|
||||
}
|
||||
defineExpose({
|
||||
onSendCode
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
Reference in New Issue
Block a user