diff --git a/src/utils/request.js b/src/utils/request.js index bbed6501..40511c3e 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -15,9 +15,12 @@ service.interceptors.response.use( // If there's an "error" property in the json, use it const edata = error.response.data.error ? error.response.data.error : error.response.data + const message = !error.response.headers['content-type'].includes('application/json') + ? `${error.message}` + : `${error.message} - ${edata}` Message({ - message: `${error.message} - ${edata}`, + message, type: 'error', duration: 5 * 1000 })