api.ts 465 B

1234567891011
  1. import { ErrorMessageMode, requestProps } from '/@/components/Form';
  2. import { defHttp } from '/@/utils/http/axios';
  3. export const httpRequest = async (request: requestProps, options?: any) => {
  4. const url = '/magic-api/' + request.requestUrl;
  5. return defHttp.desktopApi(url, request.requestType, options);
  6. };
  7. export const httpGet = async (url: string, mode: ErrorMessageMode = 'none') => {
  8. return defHttp.get<any>({ url: url }, { errorMessageMode: mode });
  9. };