{"version":3,"file":"index.mjs","sources":["../../../../src/uni-adapter/index.ts"],"sourcesContent":["import { type AxiosAdapter, type AxiosRequestConfig } from \"axios\";\nimport { Axios } from \"axios\";\nimport { getMethod } from \"./methods\";\n\nexport * from \"./axios.type\";\n\nexport const createUniAppAxiosAdapter = (): AxiosAdapter => {\n\t// 新增 download 方法\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tAxios.prototype.download = function (url, config) {\n\t\treturn this.request({\n\t\t\turl,\n\t\t\tmethod: \"download\",\n\t\t\t...config,\n\t\t});\n\t};\n\n\t// 新增 upload 方法\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tAxios.prototype.upload = function (url, data, config) {\n\t\treturn this.request({\n\t\t\turl,\n\t\t\tmethod: \"upload\",\n\t\t\tdata,\n\t\t\t...config,\n\t\t});\n\t};\n\n\tconst uniAppAdapter: AxiosAdapter = (config: AxiosRequestConfig) => {\n\t\tconst method = getMethod(config);\n\t\treturn method(config);\n\t};\n\n\treturn uniAppAdapter;\n};\n"],"names":["createUniAppAxiosAdapter","Axios","prototype","download","url","config","this","request","method","upload","data","getMethod"],"mappings":"uGAMO,MAAMA,EAA2B,KAGvCC,EAAMC,UAAUC,SAAW,SAAUC,EAAKC,GACzC,OAAOC,KAAKC,QAAQ,CACnBH,MACAI,OAAQ,cACLH,GAEL,EAIAJ,EAAMC,UAAUO,OAAS,SAAUL,EAAKM,EAAML,GAC7C,OAAOC,KAAKC,QAAQ,CACnBH,MACAI,OAAQ,SACRE,UACGL,GAEL,EAOA,OALqCA,GACrBM,EAAUN,EAClBG,CAAOH"}