src\enums下的文件

appEnum.ts

  1. // menu theme enum
  2. export enum ThemeEnum {
  3. DARK = 'dark',
  4. LIGHT = 'light',
  5. }

cacheEnum.ts

  1. // token key
  2. export const TOKEN_KEY = 'TOKEN__';
  3. // 存在LocalStorage中的国际化对象Key
  4. export const LOCALE_KEY = 'LOCALE__';
  5. // user info key
  6. export const USER_INFO_KEY = 'USER__INFO__';

httpEnum.ts

  1. /**
  2. * @description: Request result set
  3. */
  4. // http请求结果举类
  5. export enum ResultEnum {
  6. SUCCESS = 0,
  7. ERROR = 1,
  8. TIMEOUT = 401,
  9. TYPE = 'success',
  10. }
  11. /**
  12. * @description: request method
  13. */
  14. // http请求类型
  15. export enum RequestEnum {
  16. GET = 'GET',
  17. POST = 'POST',
  18. PUT = 'PUT',
  19. DELETE = 'DELETE',
  20. }
  21. /**
  22. * @description: contentTyp
  23. */
  24. // http请求的内容类型
  25. export enum ContentTypeEnum {
  26. // json
  27. JSON = 'application/json;charset=UTF-8',
  28. // form-data qs
  29. FORM_URLENCODED = 'application/x-www-form-urlencoded;charset=UTF-8',
  30. // form-data upload
  31. FORM_DATA = 'multipart/form-data;charset=UTF-8',
  32. }