From 559068a41399c1e26f2c0d692889388fc8bba73b Mon Sep 17 00:00:00 2001
From: odc.xiaohui <xiaohui@Q1>
Date: 星期四, 07 十二月 2023 09:01:19 +0800
Subject: [PATCH] 修改视频专网内网

---
 src/utils/request.ts |   25 +++++--------------------
 1 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/src/utils/request.ts b/src/utils/request.ts
index fc562aa..5d688ad 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,7 +95,7 @@
   }
 );
 
-const userStore = useUserStore();
+
 // 鍝嶅簲鎷︽埅鍣�
 service.interceptors.response.use(
   async (res: AxiosResponse) => {
@@ -107,28 +108,12 @@
       return res.data;
     }
     if (code === 401) {
+
+      const userStore = useUserStore();
       await userStore.logout()
 
       console.log(code, 'code==============');
-      router.push({ path: '/login' });
-      // prettier-ignore
-      // if (!isRelogin.show) {
-      //   // isRelogin.show = true;
-      //   isRelogin.show = true;
-      //   ElMessageBox.confirm('鐧诲綍鐘舵�佸凡杩囨湡锛屾偍鍙互缁х画鐣欏湪璇ラ〉闈紝鎴栬�呴噸鏂扮櫥褰�', '绯荤粺鎻愮ず', {
-      //     confirmButtonText: '閲嶆柊鐧诲綍',
-      //     cancelButtonText: '鍙栨秷',
-      //     type: 'warning'
-      //   }).then(() => {
-      //     isRelogin.show = false;
-      //     useUserStore().logout().then(() => {
-      //         location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
-      //       });
-      //   }).catch(() => {
-      //     isRelogin.show = false;
-      //   });
-      // }
-      // return Promise.reject('鏃犳晥鐨勪細璇濓紝鎴栬�呬細璇濆凡杩囨湡锛岃閲嶆柊鐧诲綍銆�');
+      await router.push({ path: '/login' });
       return
     } else if (code === HttpStatus.SERVER_ERROR) {
       console.log(msg);

--
Gitblit v1.8.0