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.
26 lines
519 B
26 lines
519 B
import httpRequest, { BaseResponse } from "../httpRequest";
|
|
|
|
export type User = {
|
|
id: number;
|
|
account: string;
|
|
nickname: string;
|
|
password: string;
|
|
userRole: "Admin" | "User" | "Dev";
|
|
isBuiltInUser: boolean;
|
|
};
|
|
|
|
export function login(params: { account: string; password: string }) {
|
|
return httpRequest<BaseResponse<User>>({
|
|
url: "/auth/login",
|
|
params,
|
|
method: "POST",
|
|
});
|
|
}
|
|
|
|
export function logout(params: {}) {
|
|
return httpRequest<BaseResponse>({
|
|
url: "/auth/logout",
|
|
params,
|
|
method: "POST",
|
|
});
|
|
}
|