index.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { http } from "/@/utils/http";
  2. import { loadEnv } from "@build/index";
  3. const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
  4. const userAPi = VITE_PROXY_DOMAIN_REAL;
  5. const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
  6. interface ResponseType extends Promise<any> {
  7. data?: object;
  8. code?: number;
  9. msg?: string;
  10. }
  11. // 添加
  12. export const httpAdd = (data: object): ResponseType => {
  13. return http.request("post", `${yewuApi}roleadd`, { data });
  14. };
  15. // 列表
  16. export const httpList = (data: object): ResponseType => {
  17. return http.request("post", `${yewuApi}rolelist`, { data });
  18. };
  19. // 详情
  20. export const httpDetail = (data: object): ResponseType => {
  21. return http.request("post", `${yewuApi}roleinfo`, { data });
  22. };
  23. // 更新
  24. export const httpUpdate = (data: object): ResponseType => {
  25. return http.request("post", `${yewuApi}rolesave`, { data });
  26. };
  27. // 状态
  28. export const httpStatus = (data: object): ResponseType => {
  29. return http.request("post", `${yewuApi}rolestatus`, { data });
  30. };
  31. // 删除
  32. export const httpDelete = (data: object): ResponseType => {
  33. return http.request("post", `${yewuApi}menustatus`, { data });
  34. };
  35. // 全部菜单按钮
  36. export const httpMenuAll = (data: object): ResponseType => {
  37. return http.request("post", `${yewuApi}menuactionlist`, { data });
  38. };
  39. // 全部角色
  40. export const httpRoleAll = (data: object): ResponseType => {
  41. return http.request("post", `${yewuApi}roleall`, { data });
  42. };