Update api.js
This commit is contained in:
parent
a7b21d4d06
commit
62f8397c4a
|
@ -25,13 +25,19 @@ const req = (method, url, params, responseType) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let http = fetch(url,obj).then(res => res.json());
|
let http = fetch(url,obj).then(res => res.json());
|
||||||
return http.then(response => response.data).catch(error => console.error('Error:', error));
|
return http.then(response => response).catch(error => console.error('Error:', error));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const handelResponse=(res, cb, errCb)=> {
|
||||||
|
console.log(res)
|
||||||
|
if (res.code == 200) {
|
||||||
|
cb(res)
|
||||||
|
} else {
|
||||||
|
if (typeof errCb == 'function') {
|
||||||
|
errCb()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
//营销计划列表
|
//营销计划列表
|
||||||
export const getPlanList = (params) => {
|
export const getPlanList = (params) => {
|
||||||
return req('get', baseurl + "/plan", params)
|
return req('get', baseurl + "/plan", params)
|
||||||
|
|
Loading…
Reference in New Issue