在vue中,后端返回code-500的时候 ,有时候用catch接收不到报错 ,可以直接使用下面这个进行接收。
.then((red)=>{
console.log(res);
}).catch(e=>{
this.$message.error(e.response.data.message)
})
在vue中,后端返回code-500的时候 ,有时候用catch接收不到报错 ,可以直接使用下面这个进行接收。
.then((red)=>{
console.log(res);
}).catch(e=>{
this.$message.error(e.response.data.message)
})