From ce3abc48a4f3bc72b1b34fa4ed38576af129ea34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C2=B4=C3=B3=C2=B8=C3=A7?= Date: Tue, 24 Feb 2026 14:54:41 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=B3=A8=E5=86=8C=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 3 ++- src/views/login/login.vue | 12 ++++++++++-- src/views/login/register.vue | 12 ++++++++++-- src/views/login/visible-code.vue | 10 +++++++--- 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/App.vue b/src/App.vue index 72ed79d..e35e315 100644 --- a/src/App.vue +++ b/src/App.vue @@ -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 { diff --git a/src/views/login/login.vue b/src/views/login/login.vue index dbffb06..d5779a0 100644 --- a/src/views/login/login.vue +++ b/src/views/login/login.vue @@ -48,7 +48,12 @@
- + @@ -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!') } diff --git a/src/views/login/register.vue b/src/views/login/register.vue index 3598ccc..aa60600 100644 --- a/src/views/login/register.vue +++ b/src/views/login/register.vue @@ -52,7 +52,12 @@
- + @@ -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!') } diff --git a/src/views/login/visible-code.vue b/src/views/login/visible-code.vue index 7d79a86..dea0bc9 100644 --- a/src/views/login/visible-code.vue +++ b/src/views/login/visible-code.vue @@ -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 + })