This commit is contained in:
Megghy
2023-06-07 16:01:12 +08:00
parent 4b456d2ec4
commit 2e14596be6
7 changed files with 149 additions and 60 deletions

View File

@@ -1,9 +1,8 @@
import { QueryGetAPI } from '@/api/query'
import { BASE_API } from '@/data/constants'
import { BASE_API, USER_API_URL } from '@/data/constants'
import { APIRoot, UserInfo } from './api-models'
import { ref } from 'vue'
const ACCOUNT_URL = `${BASE_API}user/`
export const USERS = ref<{ [uId: number]: UserInfo }>({})
export async function useUser(uId: number) {
@@ -17,7 +16,7 @@ export async function useUser(uId: number) {
}
export async function GetInfo(uId: number): Promise<APIRoot<UserInfo>> {
return QueryGetAPI<UserInfo>(`${ACCOUNT_URL}info`, {
return QueryGetAPI<UserInfo>(`${USER_API_URL}info`, {
uId: uId,
})
}