From bfbc77847a303a9646b9c63589706d1217f6655b Mon Sep 17 00:00:00 2001 From: odjbin <1042039504@qq.com> Date: Tue, 5 Mar 2024 21:54:30 +0800 Subject: [PATCH] =?UTF-8?q?fix=20:=20=E4=BF=AE=E5=A4=8Dloading=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/cas-login/index.vue | 11 ++++++----- src/views/login/index.vue | 6 +++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/views/cas-login/index.vue b/src/views/cas-login/index.vue index 9cdd6a8..996d4e5 100644 --- a/src/views/cas-login/index.vue +++ b/src/views/cas-login/index.vue @@ -8,14 +8,15 @@ const router = useRouter(); const tokenValue = reactive(router.currentRoute.value.query.token) console.log('tokenValue', tokenValue) const init = () => { - // console.log('authStore.casToken(tokenValue)',authStore.casToken(tokenValue)) + const loading = ElLoading.service({ + lock: true, + text: '登录中...', + background: 'rgba(0, 0, 0, 0.7)', + }) if (authStore.casToken(tokenValue)) { - // ElLoading.service({text: '正在加载系统资源', background: '#409eff', lock: true}) + loading.close() router.push('/') } - // else { - // router.push('/login') - // } } init() diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 6ddf529..918cd88 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -66,10 +66,14 @@ const handleLogin = (instance) => { if(!instance) return instance.validate( async (valid, fields)=>{ if (!valid) return + ElLoading.service({ + lock: true, + text: '登录中...', + background: 'rgba(0, 0, 0, 0.7)', + }) // 发送请求 await authStore.userLogin(loginForm).then(res=>{ if(res) { - ElLoading.service({text: '正在加载系统资源',background: '#409eff',lock: true}) router.push('/') }else { getCode()