From 38efe4483d31671a7ba624870e7934514d190d95 Mon Sep 17 00:00:00 2001 From: Cxx0822 <1556464090@qq.com> Date: Wed, 11 Jun 2025 20:04:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Home/Login/CommonLogin.vue | 19 +++++++++++-------- src/store/auth.ts | 1 + 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/Home/Login/CommonLogin.vue b/src/components/Home/Login/CommonLogin.vue index 748422e..af29d94 100644 --- a/src/components/Home/Login/CommonLogin.vue +++ b/src/components/Home/Login/CommonLogin.vue @@ -48,7 +48,7 @@
登录管理系统 @@ -85,7 +85,7 @@ import { onMounted, reactive, ref } from 'vue' import { loginRules } from '@/utils/element/elRules' import { getLocalStorage, setLocalStorage } from 'vue3-common/utils/storageUtil' import { ILoginType } from '@/types/auth' -import {isMobile} from "vue3-common/utils/layoutUtil"; +import { isMobile } from 'vue3-common/utils/layoutUtil' const rules = reactive(loginRules) const authStore = useAuthStore() @@ -104,20 +104,22 @@ onMounted(() => { const handleLogin = async (type: ILoginType) => { loginFormRef.value.validate(async (valid: any) => { if (valid) { - authStore.loginLoading = true - if (type === 'common' && !isMobile()) { - ElMessage.error("目前只支持移动端") - authStore.loginLoading = false + ElMessage.error('目前只支持移动端') return } if (type === 'admin' && isMobile()) { - ElMessage.error("目前只支持PC端") - authStore.loginLoading = false + ElMessage.error('目前只支持PC端') return } + if (type === 'common') { + authStore.loginLoading = true + } else { + authStore.loginAdminLoading = true + } + try { await authStore.handleLogin(type) userStore.handleSession(authStore.homeSession) @@ -134,6 +136,7 @@ const handleLogin = async (type: ILoginType) => { } } finally { authStore.loginLoading = false + authStore.loginAdminLoading = false } } else { ElMessage.error('请输入正确的信息') diff --git a/src/store/auth.ts b/src/store/auth.ts index c02c331..4e58e62 100644 --- a/src/store/auth.ts +++ b/src/store/auth.ts @@ -21,6 +21,7 @@ export const useAuthStore = defineStore('auth', { }, loginType: 'common' as ILoginType, loginLoading: false, + loginAdminLoading: false, isVerified: false, isGettingCode: false, getCodeCountdown: 60,