npm install @daluobo/fetchwrap;
import fetchWrap from '@daluobo/fetchwrap';
参数为:(api, data = {}, headers = {}, config = {})
fetchWrap.get('/test-fetch')
.then((res) => {
console.log('res:', res);
})
.catch((err) => {
console.log('error:', err);
})
参数为:(api, data = {}, headers = {}, config = {})
fetchWrap.post('/test-fetch')
.then((res) => {
console.log('res:', res);
})
.catch((err) => {
console.log('error:', err);
})