previously you could handle this in ajax
request(param){
$.ajax{
type: param.type,
url: param.url,
success(res){
if(res.status === 0){
typeof param.success === "function" && param.success(res.data)
}else if(res.status === 1){
login()
}else if(res.status === 2){
typeof param.success === "function" && param.success(res.data)
}
},
error(err){
typeof param.error === "function" && param.error(res.err)
}
}
}
in a case like the one above, for example, a status of 0 indicates success, and then the processing is performed after success. How do you deal with this in axios?