http.enum.ts 884 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * @description: Request result set
  3. */
  4. export enum ResultEnum {
  5. SUCCESS = 0,
  6. ERROR = 500,
  7. TIMEOUT = 401,
  8. TYPE = 'success'
  9. }
  10. /**
  11. * @description: request method
  12. */
  13. export enum RequestEnum {
  14. GET = 'GET',
  15. POST = 'POST',
  16. PUT = 'PUT',
  17. DELETE = 'DELETE'
  18. }
  19. /**
  20. * @description: contentType
  21. */
  22. export enum ContentTypeEnum {
  23. // json
  24. JSON = 'application/json;charset=UTF-8',
  25. // form-data qs
  26. FORM_URLENCODED = 'application/x-www-form-urlencoded;charset=UTF-8',
  27. // form-data upload
  28. FORM_DATA = 'multipart/form-data;charset=UTF-8'
  29. }
  30. /**
  31. * Exception related enumeration
  32. */
  33. export enum ExceptionEnum {
  34. // page not access
  35. PAGE_NOT_ACCESS = 403,
  36. // page not found
  37. PAGE_NOT_FOUND = 404,
  38. // error
  39. ERROR = 500,
  40. // net work error
  41. NET_WORK_ERROR = 10000,
  42. // No data on the page. In fact, it is not an exception page
  43. PAGE_NOT_DATA = 10100
  44. }