Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const checkStatus = response => {
if (response.status >= 200 && response.status < 300) {
return response;
}
const errortext = codeMessage[response.status] || response.statusText;
Toast.offline(`请求错误 ${response.status}: ${response.url},${errortext}`);
const error = new Error(errortext);
error.name = response.status;
error.response = response;
throw error;
};
}).catch(() => { Toast.offline('网络异常,请稍后再试!') })
}
const checkStatus = response => {
if (response.status >= 200 && response.status < 300) {
return response;
}
const errortext = codeMessage[response.status] || response.statusText;
Toast.offline(`请求错误 ${response.status}: ${response.url},${errortext}`);
const error = new Error(errortext);
error.name = response.status;
error.response = response;
throw error;
};
}).catch(() => { Toast.offline('抱歉,网络错误,请稍后再试!') })
}
window.addEventListener('sw.offline', () => {
Toast.offline('当前处于离线状态');
});
}).catch(() => { Toast.offline('抱歉,网络错误,请稍后再试。') })
}
}).catch(() => { Toast.offline('抱歉,网络错误,请稍后再试!') })
}
}).catch(() => { Toast.offline('网络异常,请稍后再试!') })
}
popoverSelect=(options)=>{
if(options.key==="1"){
Toast.offline('听歌识曲功能未开放', 1);
}else if(options.key==="2"){
Toast.offline('扫一扫功能未开放', 1);
}
this.setState({
popover:false
});
}
render(){
}).catch(() => { Toast.offline('抱歉,网络错误,请稍后再试!') })
})