get personal info
This commit is contained in:
parent
13bac9e40c
commit
041ea5dd3a
2 changed files with 32 additions and 4 deletions
|
|
@ -63,6 +63,14 @@ export const useAuthStore = defineStore('auth', () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const userInfo = async () => {
|
||||||
|
try {
|
||||||
|
return await apiClient.get('/user')
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Register error:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
accessToken,
|
accessToken,
|
||||||
user,
|
user,
|
||||||
|
|
@ -72,5 +80,6 @@ export const useAuthStore = defineStore('auth', () => {
|
||||||
logout,
|
logout,
|
||||||
forceLogout,
|
forceLogout,
|
||||||
register,
|
register,
|
||||||
|
userInfo,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,30 @@
|
||||||
<script setup lang="ts">
|
<script setup>
|
||||||
|
import List from '@/views/PersonalView/List.vue'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
Personal view
|
<n-grid
|
||||||
|
responsive="screen"
|
||||||
|
item-responsive
|
||||||
|
cols="24"
|
||||||
|
:x-gap="16"
|
||||||
|
:y-gap="16"
|
||||||
|
>
|
||||||
|
<n-gi span="xs:1 s:1 m:2 l:2 xl:3 xxl:3"/>
|
||||||
|
|
||||||
|
<n-gi span="xs:22 s:22 m:20 l:20 xl:18 xxl:18">
|
||||||
|
<n-card class="personal-card"
|
||||||
|
bordered title="Personal info">
|
||||||
|
<List />
|
||||||
|
</n-card>
|
||||||
|
</n-gi>
|
||||||
|
|
||||||
|
<n-gi span="xs:1 s:1 m:2 l:2 xl:3 xxl:3"/>
|
||||||
|
</n-grid>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.personal-card {
|
||||||
|
margin: 10px auto 0;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue