export function getMenu() {
fetch('url').then((res)=>{
if(res.ok){
return res.json();
}
}).catch((res)=>{
console.log(res.status);
});
}
Fetch promise怎么写 新手
erp_hao
#1
1020431880
#4
fetch(‘http://api/getData.do’).then(response=>response.json()).then(response=>{
console.log(response);
});