mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-07 02:46:55 +08:00
support guard price
This commit is contained in:
@@ -2,7 +2,7 @@ import { QueryGetAPI } from '@/api/query'
|
||||
import { USER_API_URL, apiFail } from '@/data/constants'
|
||||
import { ref } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { APIRoot, UserInfo } from './api-models'
|
||||
import { APIRoot, UserBasicInfo, UserInfo } from './api-models'
|
||||
|
||||
export const USERS = ref<{ [id: string]: UserInfo }>({})
|
||||
|
||||
@@ -38,6 +38,10 @@ export async function useUserWithUId(id: number) {
|
||||
}
|
||||
return USERS.value[id.toString()]
|
||||
}
|
||||
export async function getUserBasicInfo(id: string | number | undefined) {
|
||||
if (!id) return undefined
|
||||
return (await QueryGetAPI<UserBasicInfo>(`${USER_API_URL}basic/${id}`)).data
|
||||
}
|
||||
|
||||
export async function GetInfo(id: string): Promise<APIRoot<UserInfo>> {
|
||||
return QueryGetAPI<UserInfo>(`${USER_API_URL}info`, {
|
||||
|
||||
Reference in New Issue
Block a user