import { routerConfig } from '/nerv-lib/saas/config/router.config';

export enum ResultEnum {
  SUCCESS = 0,
  ERROR = 1,
  TIMEOUT = 401,
  TOKEN_INVALID = 403,
}

export enum RequestEnum {
  GET = 'POST',
  POST = 'POST',
  PUT = 'POST',
  DELETE = 'POST',
}

export enum ContentTypeEnum {
  // json
  JSON = 'application/json;charset=UTF-8',
  // form-data qs
  FORM_URLENCODED = 'application/x-www-form-urlencoded;charset=UTF-8',
  // form-data  upload
  FORM_DATA = 'multipart/form-data;charset=UTF-8',
}

export const errCodeMap = new Map<number, any>([
  [13, ''],
  [1, ''],
  [11, ''],
  [3005, ''],
  [10086, () => routerConfig.logout()],
]);
