From e19cf3c81d4e45654442233afd4a002afeaa5143 Mon Sep 17 00:00:00 2001
From: odc.xiaohui <xiaohui@Q1>
Date: 星期一, 04 十二月 2023 17:54:53 +0800
Subject: [PATCH] 修改视频专网

---
 src/utils/request.ts |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/utils/request.ts b/src/utils/request.ts
index b4f2620..ebd7d89 100644
--- a/src/utils/request.ts
+++ b/src/utils/request.ts
@@ -11,6 +11,7 @@
 import { encryptBase64, encryptWithAes, generateAesKey } from '@/utils/crypto';
 import { encrypt } from '@/utils/jsencrypt';
 import router from "@/router";
+import { ElLoading, ElMessage, ElNotification } from "element-plus";
 
 let downloadLoadingInstance: LoadingInstance;
 // 鏄惁鏄剧ず閲嶆柊鐧诲綍
@@ -94,9 +95,10 @@
   }
 );
 
+
 // 鍝嶅簲鎷︽埅鍣�
 service.interceptors.response.use(
-  (res: AxiosResponse) => {
+  async (res: AxiosResponse) => {
     // 鏈缃姸鎬佺爜鍒欓粯璁ゆ垚鍔熺姸鎬�
     const code = res.data.code || HttpStatus.SUCCESS;
     // 鑾峰彇閿欒淇℃伅
@@ -106,8 +108,12 @@
       return res.data;
     }
     if (code === 401) {
-      console.log(code,'code==============');
-      router.push({ path: '/login' });
+
+      const userStore = useUserStore();
+      await userStore.logout()
+
+      console.log(code, 'code==============');
+      await router.push({ path: '/login' });
       // prettier-ignore
       // if (!isRelogin.show) {
       //   // isRelogin.show = true;

--
Gitblit v1.8.0