提交 e2142fe5 编写于 作者: View Design's avatar View Design

更新用户信息

上级 27350b1e
...@@ -7,7 +7,11 @@ ...@@ -7,7 +7,11 @@
<UNotifications /> <UNotifications />
</template> </template>
<script setup> <script setup>
const { $updateUserInfo } = useUserStore()
useHead({ useHead({
title: 'GitBot AI' title: 'GitBot AI'
}) })
nextTick(() => {
$updateUserInfo()
})
</script> </script>
...@@ -19,5 +19,10 @@ export const useUserStore = defineStore('user', () => { ...@@ -19,5 +19,10 @@ export const useUserStore = defineStore('user', () => {
userInfo.value = null 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 }
}) })
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册