最近碰到出现Uncaught (in promise)的问题,
之前不知道前端也有异常处理的方法 我的实际情况是 ,后端传回来的是
throw new BusinessException("无待办实例,异常流程,数据回滚");
但是并没有被处理 所以报错
附解决方法 :
updateSellElecParticipantStatus(json).then((response) => {
console.log(response)
if(res.code===10000){
this.$message.error("审核数据异常")
}else{
this.$message.success("审核通过")
}
}).catch((e) => {
this.$message.error("审核数据异常")
});
捕获异常
catch((e) => {
this.$message.error("审核数据异常")
});