From e2142fe521d8725a102187ad751c1427800cb334 Mon Sep 17 00:00:00 2001 From: Aresn Date: Mon, 27 May 2024 11:22:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=94=A8=E6=88=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.vue | 4 ++++ stores/user.js | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app.vue b/app.vue index 1e01a95..6a0956c 100644 --- a/app.vue +++ b/app.vue @@ -7,7 +7,11 @@ diff --git a/stores/user.js b/stores/user.js index 70b78b8..e995231 100644 --- a/stores/user.js +++ b/stores/user.js @@ -19,5 +19,10 @@ export const useUserStore = defineStore('user', () => { userInfo.value = null } - return { $info, $isSignIn, $signOut } + async function $updateUserInfo () { + const { data } = await useRequest('/v1/user/user_info') + userInfo.value = JSON.stringify(data.value.data) + } + + return { $info, $isSignIn, $signOut, $updateUserInfo } }) -- GitLab