Merge pull request #18 from SupGiant/master

request支持传递axios原生参数,例如超时:request(method:'GET',url:'',timeout:1000)
This commit is contained in:
芋道源码 2023-08-05 12:23:33 +08:00 committed by GitHub
commit d12887b60a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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