Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}, error => {
if (error.response) {
let code = error.response.status;
switch (code) {
case 500:
Message.error(error.response.data.RetMsg)
break;
default:
Message.error(codeMessage[code])
}
}
return Promise.reject(error.response.data);// 返回接口返回的错误信息
})
}, error => {
if (error.response) {
let code = error.response.status;
switch (code) {
case 500:
Message.error(error.response.data.RetMsg)
break;
default:
Message.error(codeMessage[code])
}
}
return Promise.reject(error.response.data);// 返回接口返回的错误信息
})
function errorMessage(content) {
console.log(content)
Message.error({
content: content,
duration: 5,
closable: true
})
}