From 9a02598c00c0af120b38cfd09229abe17b10c4b7 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子Li <15040126243@163.com>
Date: 星期五, 25 十月 2024 11:13:13 +0800
Subject: [PATCH] !151 发布 vue 版本 5.2.3 与 cloud 版本 2.2.2 Merge pull request !151 from 疯狂的狮子Li/dev

---
 src/utils/request.ts |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/utils/request.ts b/src/utils/request.ts
index f2a69f0..f8f1f53 100644
--- a/src/utils/request.ts
+++ b/src/utils/request.ts
@@ -10,6 +10,7 @@
 import { getLanguage } from '@/lang';
 import { encryptBase64, encryptWithAes, generateAesKey, decryptWithAes, decryptBase64 } from '@/utils/crypto';
 import { encrypt, decrypt } from '@/utils/jsencrypt';
+import router from "@/router";
 
 const encryptHeader = 'encrypt-key';
 let downloadLoadingInstance: LoadingInstance;
@@ -134,8 +135,13 @@
         }).then(() => {
           isRelogin.show = false;
           useUserStore().logout().then(() => {
-              location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
-            });
+            router.replace({
+              path: '/login',
+              query: {
+                redirect: encodeURIComponent(router.currentRoute.value.fullPath || '/')
+              }
+            })
+          });
         }).catch(() => {
           isRelogin.show = false;
         });

--
Gitblit v1.9.3