index.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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}supplierAccountAdd`, { data });
  14. };
  15. // 列表
  16. export const httpList = (data: object = {}): ResponseType => {
  17. return http.request("post", `${yewuApi}usersinglelist`, { data : {
  18. ...data,
  19. level: "3"
  20. }});
  21. };
  22. // 详情
  23. export const httpDetail = (data: object): ResponseType => {
  24. return http.request("post", `${yewuApi}userinfo`, { data });
  25. };
  26. // 更新
  27. export const httpUpdate = (data: object): ResponseType => {
  28. return http.request("post", `${yewuApi}usersave`, { data });
  29. };
  30. // 状态
  31. export const httpStatus = (data: object): ResponseType => {
  32. return http.request("post", `${yewuApi}setstatus`, { data });
  33. };
  34. // 删除
  35. export const httpDelete = (data: object): ResponseType => {
  36. return http.request("post", `${yewuApi}menustatus`, { data });
  37. };
  38. // 重置密码
  39. export const httpSetPwd = (data: object): ResponseType => {
  40. return http.request("post", `${yewuApi}setpwd`, { data });
  41. };
  42. // 全部角色
  43. export const httpRoleAll = (data: object): ResponseType => {
  44. return http.request("post", `${yewuApi}roleall`, { data });
  45. };
  46. // 设置角色
  47. export const httpSetRole = (data: object): ResponseType => {
  48. return http.request("post", `${yewuApi}setrole`, { data });
  49. };