27 lines
460 B
TypeScript
27 lines
460 B
TypeScript
|
import { APIClient } from "./ApiClient";
|
||
|
|
||
|
export interface User {
|
||
|
id: number;
|
||
|
name: string;
|
||
|
email: string;
|
||
|
time_create: number;
|
||
|
time_activate: number;
|
||
|
active: boolean;
|
||
|
admin: boolean;
|
||
|
has_password: boolean;
|
||
|
}
|
||
|
|
||
|
export class UserApi {
|
||
|
/**
|
||
|
* Get current user information
|
||
|
*/
|
||
|
static async GetUserInfo(): Promise<User> {
|
||
|
return (
|
||
|
await APIClient.exec({
|
||
|
uri: "/user/info",
|
||
|
method: "GET",
|
||
|
})
|
||
|
).data;
|
||
|
}
|
||
|
}
|