From fe384a3020fd2080d843704537b77954a8d82707 Mon Sep 17 00:00:00 2001
From: ahao <liuhaoai545@gmail.com>
Date: 星期五, 29 九月 2023 00:06:57 +0800
Subject: [PATCH] fix #I8550V https://gitee.com/dromara/RuoYi-Vue-Plus/issues/I8550V

---
 src/views/login.vue |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/views/login.vue b/src/views/login.vue
index 1084c02..e5c73fa 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -100,6 +100,10 @@
 // 绉熸埛鍒楄〃
 const tenantList = ref<TenantVO[]>([]);
 
+watch(() => router.currentRoute.value, (newRoute: any) => {
+  redirect.value = newRoute.query && newRoute.query.redirect;
+}, { immediate: true });
+
 const handleLogin = () => {
   loginRef.value?.validate(async (valid: boolean, fields: any) => {
     if (valid) {
@@ -121,6 +125,7 @@
       const [err] = await to(userStore.login(loginForm.value));
       if (!err) {
         await router.push({ path: redirect.value || '/' });
+        loading.value = false;
       } else {
         loading.value = false;
         // 閲嶆柊鑾峰彇楠岃瘉鐮�

--
Gitblit v1.9.3