19 lines
472 B
TypeScript
19 lines
472 B
TypeScript
import type { CreateUserBody, LoginUserBody, UserInfo } from '@core';
|
|
import { post, get } from './request';
|
|
|
|
export async function login(raw: LoginUserBody) {
|
|
return post<UserInfo>('/user/login', raw);
|
|
}
|
|
|
|
export async function logout() {
|
|
await post<void>('/user/logout');
|
|
}
|
|
|
|
export async function read(uuid: string) {
|
|
return get<UserInfo>(`/user/read/${uuid}`);
|
|
}
|
|
|
|
export async function create(raw: CreateUserBody) {
|
|
return post<UserInfo>('/user/create', raw);
|
|
}
|