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

  1. import httpRequest, { BaseResponse } from "../httpRequest";
  2. export type User = {
  3. id: number;
  4. account: string;
  5. nickname: string;
  6. password: string;
  7. userRole: "Admin" | "User" | "Dev";
  8. isBuiltInUser: boolean;
  9. };
  10. export function login(params: { account: string; password: string }) {
  11. return httpRequest<BaseResponse<User>>({
  12. url: "/auth/login",
  13. params,
  14. method: "POST",
  15. });
  16. }
  17. export function logout(params: {}) {
  18. return httpRequest<BaseResponse>({
  19. url: "/auth/logout",
  20. params,
  21. method: "POST",
  22. });
  23. }