You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
665 B
21 lines
665 B
import httpRequest, { type BaseResponse } from "../httpRequest";
|
|
|
|
export function login(params: { username: string; password: string }) {
|
|
return httpRequest<BaseResponse<string>>({ url: `/api/auth/login`, method: "POST", params });
|
|
}
|
|
|
|
export type User = {
|
|
id: number;
|
|
username: string;
|
|
nickname: string; // 用户显示
|
|
password: string;
|
|
role: number; // 1: admin
|
|
};
|
|
|
|
export function getUserList(params: { pageNum: number; pageSize: number }) {
|
|
return httpRequest<BaseResponse<{ list: User[]; total: number }>>({ url: "/api/user/list", params });
|
|
}
|
|
|
|
export function getCurrentUser() {
|
|
return httpRequest<BaseResponse<User>>({ url: "/api/user/current" });
|
|
}
|