You've already forked guangan-mp
1.0.0
This commit is contained in:
16
uni_modules/uni-ajax/js_sdk/lib/defaults.js
Normal file
16
uni_modules/uni-ajax/js_sdk/lib/defaults.js
Normal 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
|
Reference in New Issue
Block a user