This commit is contained in:
xixingwl
2023-02-04 08:50:14 +08:00
commit 98cfbb0b77
89 changed files with 9508 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import adapter from './adapters/http'
import { forEach } from './utils'
export const METHOD = ['get', 'post', 'put', 'delete', 'connect', 'head', 'options', 'trace']
export const HEADER = ['common', ...METHOD]
const defaults = {
adapter,
header: {},
method: 'GET',
validateStatus: statusCode => statusCode >= 200 && statusCode < 300
}
forEach(HEADER, h => (defaults.header[h] = {}))
export default defaults