first commit

This commit is contained in:
2026-02-18 14:30:42 +08:00
commit f79920ad6a
212 changed files with 3850 additions and 0 deletions

24
src/api/user.ts Normal file
View File

@@ -0,0 +1,24 @@
import { authedRequest, type AuthSession } from './authed-request'
export interface UserInfo {
userID?: string
username?: string
phone?: string
email?: string
nickname?: string
[key: string]: unknown
}
const USER_INFO_PATH = import.meta.env.VITE_USER_INFO_PATH ?? '/api/v1/user/info'
export async function getUserInfo(
auth: AuthSession,
onAuthUpdated?: (next: AuthSession) => void,
): Promise<UserInfo> {
return authedRequest<UserInfo>({
method: 'GET',
path: USER_INFO_PATH,
auth,
onAuthUpdated,
})
}