mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
refactor: rewrite user profile store using pinia
This commit is contained in:
1 parent
103ce4774c
commit
8a31a58c56
8 files changed
+68
-178
No files matched your search
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user