refactor: 修改验证码的加载时间

This commit is contained in:
valarchie 2023-06-24 09:45:04 +08:00
parent 76efc1d28c
commit 8d59c5f9a1

View File

@ -1,5 +1,12 @@
<script setup lang="ts">
import { ref, toRaw, reactive, onMounted, onBeforeUnmount } from "vue";
import {
ref,
toRaw,
reactive,
onMounted,
onBeforeUnmount,
onBeforeMount
} from "vue";
import Motion from "./utils/motion";
import { useRouter } from "vue-router";
import { message } from "@/utils/message";
@ -90,6 +97,10 @@ async function getCaptchaCode() {
});
}
onBeforeMount(() => {
getCaptchaCode();
});
onMounted(() => {
window.document.addEventListener("keypress", onkeypress);
getCaptchaCode();