添加登录注册接口

This commit is contained in:
2026-02-23 10:08:37 +08:00
parent 86d58330d5
commit e2632d921f
8 changed files with 101 additions and 86 deletions

View File

@@ -12,6 +12,7 @@
</template>
<script setup lang="ts">
import { SendVerificationCode } from '@/api/login'
import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
import { CountDown } from '@/utils/tools'
import InputCode from '@/components/input-code.vue'
@@ -44,11 +45,20 @@
clearTime()
})
onMounted(() => {
setTime()
onSendCode()
})
const onSendCode = async () => {
const email = props.email
if (!email) {
console.warn('请输入邮箱')
return
}
setTime()
await SendVerificationCode({ email })
}
const onResend = () => {
if (time.value > 0) return
setTime()
onSendCode()
}
const onVerify = () => {
if (code.value.length !== 6) return