perf: 登录页在页面组件加载完成前显示loading

This commit is contained in:
fit2cloud-chenyw 2024-09-18 16:28:12 +08:00
parent e74015ed75
commit 1da746f507

View File

@ -88,7 +88,7 @@ const getCurLocation = () => {
}
const formRef = ref<FormInstance | undefined>()
const duringLogin = ref(false)
const duringLogin = ref(true)
const handleLogin = () => {
if (!formRef.value) return
formRef.value.validate(async (valid: boolean) => {
@ -226,6 +226,7 @@ const switchTab = (name: string) => {
}
onMounted(async () => {
loadArrearance()
duringLogin.value = false
if (!checkPlatform()) {
const res = await loginCategoryApi()
const adminLogin = router.currentRoute?.value?.name === 'admin-login'