31 lines
804 B
TypeScript
31 lines
804 B
TypeScript
import { sleep } from "@/core/sleep";
|
|
import { get, post } from "./request";
|
|
|
|
|
|
export async function saveUser(params: Partial<UserInfo>) {
|
|
await sleep(200);
|
|
return await post<UserInfo>(`/user/save`, params);
|
|
}
|
|
|
|
export function userLogin(params: LoginModel) {
|
|
return post<{ token: string; user: UserInfo }>(`/user/login`, params);
|
|
}
|
|
|
|
export function getInfo() {
|
|
return get<UserInfo>(`/user/info`);
|
|
}
|
|
|
|
export async function getList(param: UserSearchParam) {
|
|
await sleep(200);
|
|
return await post<DataList<UserInfo>>(`/user/all`, param);
|
|
}
|
|
|
|
export function deleteUser(id:number){
|
|
return post(`/user/delete`,{id})
|
|
}
|
|
|
|
export const columns = [
|
|
{ title: '姓名', dataIndex: 'nickname' },
|
|
{ title: '账号', dataIndex: 'account' },
|
|
{ title: '角色', dataIndex: 'role' },
|
|
] |