From d9c95da636d21797c970730a078c60a62b205ae4 Mon Sep 17 00:00:00 2001 From: mingchiuli Date: Tue, 14 Jan 2025 23:15:50 +0800 Subject: [PATCH] add long http --- src/utils/tools.ts | 4 ++-- src/views/LoginView.vue | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/utils/tools.ts b/src/utils/tools.ts index 8e197212..82df9ea2 100644 --- a/src/utils/tools.ts +++ b/src/utils/tools.ts @@ -1,4 +1,4 @@ -import http from '@/http/axios' +import client from '@/http/axios' import { DOWNLOAD_DATA, GET, POST } from '@/http/http' import router from '@/router' import { buttonStore, loginStateStore, menuStore, tabStore, authMarkStore } from '@/stores/store' @@ -74,7 +74,7 @@ export const checkAccessToken = async (accessToken: string): Promise => //ten minutes if (jwt.exp - now < 600) { const refreshToken = getLocalStorageItem('refreshToken') - const data = await http.get>('/token/refresh', { + const data = await client.http.get>('/token/refresh', { headers: { Authorization: refreshToken } }) const token = data.data.accessToken diff --git a/src/views/LoginView.vue b/src/views/LoginView.vue index 4d7a7359..e5b16837 100644 --- a/src/views/LoginView.vue +++ b/src/views/LoginView.vue @@ -1,7 +1,7 @@