我有一个存储方法...
async store() {
try {
return await axios.post('/upload', data);
} catch (error) {
}
},
调用者:
store().then(()=>{ console.log('ok'); }, ()=>{ console.log('not ok'); });
但是当 store 方法失败并捕获到错误时,then总是调用第一个方法,如何才能not ok调用失败的方法?
RISEBY
智慧大石
随时随地看视频慕课网APP
相关分类