45 lines
1.1 KiB
Vue
45 lines
1.1 KiB
Vue
<script setup>
|
|
import { computed } from 'vue';
|
|
import { useWindowSize } from '@vueuse/core';
|
|
import { useAuth } from '@/store/auth/index.js';
|
|
import size375 from '@/views/login/size375/index.vue';
|
|
import size768 from '@/views/login/size768/index.vue';
|
|
import size1440 from '@/views/login/size1440/index.vue';
|
|
import size1920 from '@/views/login/size1920/index.vue';
|
|
import {deadlineAPI} from "@/api/auth/index.js";
|
|
import {useRouter} from "vue-router";
|
|
const { clickSendCode } = useAuth();
|
|
|
|
const router = useRouter()
|
|
const { width } = useWindowSize();
|
|
const viewComponent = computed(() => {
|
|
const viewWidth = width.value;
|
|
if (viewWidth <= 450) {
|
|
return size375;
|
|
} else if (viewWidth <= 1100) {
|
|
return size768;
|
|
} else if (viewWidth <= 1500) {
|
|
return size1440;
|
|
} else if (viewWidth <= 1920 || viewWidth > 1920) {
|
|
return size1920;
|
|
}
|
|
})
|
|
deadlineAPI().then((res)=>{
|
|
if(res.data.status===2){
|
|
router.push({
|
|
path: '/result',
|
|
query: {
|
|
type: 'end'
|
|
}
|
|
})
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<component @sendCode="clickSendCode" :is="viewComponent" />
|
|
</template>
|
|
|
|
<style scoped lang="scss">
|
|
</style>
|