重构CheckBox组件

This commit is contained in:
lyswhut
2019-08-18 15:18:05 +08:00
parent 6e07719c2c
commit ba8991a034
8 changed files with 138 additions and 46 deletions

View File

@@ -4,7 +4,7 @@ import { debugRequest } from './env'
// import fs from 'fs'
const fatchData = (url, method, options, callback) => {
console.log('---start---', url)
// console.log('---start---', url)
return request(url, {
method,
headers: options.headers,
@@ -14,11 +14,16 @@ const fatchData = (url, method, options, callback) => {
json: options.format === undefined || options.format === 'json',
}, (err, resp, body) => {
if (err) return callback(err, null)
console.log('---end---', url)
// console.log('---end---', url)
callback(null, resp, body)
})
}
/**
* promise 形式的请求方法
* @param {*} url
* @param {*} options
*/
export const httpFatch = (url, options = { method: 'get' }) => {
let requestObj
let cancelFn