From a2a281d76a809bcb52718e0a0bf8188a614f2980 Mon Sep 17 00:00:00 2001 From: xxx Date: Thu, 7 Sep 2023 16:55:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0=20async?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=E5=9B=A0=E4=B8=BA=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E7=BC=93=E6=85=A2=E5=AF=BC=E8=87=B4=E9=A6=96=E9=A1=B5=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/login/index.ts | 10 +++++----- src/stores/userInfo.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/api/login/index.ts b/src/api/login/index.ts index 16db8389..a3e6b844 100644 --- a/src/api/login/index.ts +++ b/src/api/login/index.ts @@ -144,11 +144,11 @@ export const checkToken = (refreshTime: number, refreshLock: boolean) => { /** * 获取用户信息 */ -export const getUserInfo = () => { - return request({ - url: '/admin/user/info', - method: 'get', - }); +export const getUserInfo = async () => { + return request({ + url: '/admin/user/info', + method: 'get', + }); }; export const logout = () => { diff --git a/src/stores/userInfo.ts b/src/stores/userInfo.ts index 60c8679a..cdf00eb8 100644 --- a/src/stores/userInfo.ts +++ b/src/stores/userInfo.ts @@ -122,7 +122,7 @@ export const useUserInfo = defineStore('userInfo', { * @async */ async setUserInfos() { - getUserInfo().then((res) => { + await getUserInfo().then((res) => { const userInfo: any = { user: res.data.sysUser, time: new Date().getTime(), From 29ac56daed05b5544c68ef52be80e20d7dc6a0bd Mon Sep 17 00:00:00 2001 From: xxx Date: Fri, 8 Sep 2023 10:50:18 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E7=9A=84=20async?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/login/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/login/index.ts b/src/api/login/index.ts index a3e6b844..f30cb452 100644 --- a/src/api/login/index.ts +++ b/src/api/login/index.ts @@ -144,7 +144,7 @@ export const checkToken = (refreshTime: number, refreshLock: boolean) => { /** * 获取用户信息 */ -export const getUserInfo = async () => { +export const getUserInfo = () => { return request({ url: '/admin/user/info', method: 'get',