Vue axios configuration axios interceptor does not work

is there a problem with neither 504 nor 500 as shown in the following code?


error error

how can I get the status code of error?


switch case is used incorrectly, break is missing

case 500:
          loadinginstace.close();
          Message.error({
            message: ""
          });
break;

I have the same problem. I feel that axois's interceptor is not very easy to use, but Angular's interceptor is still powerful.
Update: you can get status in the following way

const status = err.toString().match(/\d{3}/)[0];

validateStatus: function (status) {
    return status >= 200 && status < 300; // default
},

because this is blocked, if you want to see all the http status, return true directly. You can get all the information in axios.interceptors.response.use 's callback , not an error callback.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b31ce1-34172.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b31ce1-34172.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?