From 180a6b9c34a95430bd91e91ac72d5b7abdbf7f4c Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期五, 27 十二月 2024 23:04:34 +0800
Subject: [PATCH] 关闭页面登出 ||

---
 src/App.vue |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/App.vue b/src/App.vue
index 54b374a..57f6d29 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -6,6 +6,7 @@
 import routerSearch from '@/components/RouterSearch/index.vue'
 import {useUserStore} from "@/store/modules/user";
 import {useTagsViewStore} from "@/store/modules/tagsView";
+import {getAccessToken} from "@/utils/auth";
 
 defineOptions({ name: 'APP' })
 
@@ -40,7 +41,12 @@
 })
 
 const handleUnload = async () => {
-  await userStore.loginOut()
+  //await userStore.loginOut()
+  if (getAccessToken()) {
+    const loginouturl = import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/system/auth/logout' + '?token=' + getAccessToken()
+    navigator.sendBeacon(loginouturl, JSON.stringify(""))
+  }
+
   tagsViewStore.delAllViews()
 }
 

--
Gitblit v1.9.3