request支持传递axios原生参数,例如超时:request(method:'GET',url:'',timeout:1000)

pull/196/head
linr 2023-08-02 16:55:28 +08:00
parent ee802d6335
commit 0c334ff4d6
1 changed files with 2 additions and 1 deletions

View File

@ -5,12 +5,13 @@ import { config } from './config'
const { default_headers } = config
const request = (option: any) => {
const { url, method, params, data, headersType, responseType } = option
const { url, method, params, data, headersType, responseType, ...config } = option
return service({
url: url,
method,
params,
data,
...config,
responseType: responseType,
headers: {
'Content-Type': headersType || default_headers