refactor: rewrite user profile store using pinia

This commit is contained in:
wancat committed 2024-06-27 10:48:08 +08:00
1 parent 103ce4774c
commit 8a31a58c56
8 files changed
+68 -178

No files matched your search

+6
View File
@@ -1,4 +1,5 @@
import axios from 'axios'
import { UserProfile } from '../store/userProfile'
const api = axios.create({
baseURL: '/api/v1',
@@ -8,3 +9,8 @@ const api = axios.create({
withCredentials: true,
})
export default api
export async function getUserProfile(): Promise<UserProfile> {
const res = await api.get<UserProfile>('/users/me')
return res.data
}