before the-sharp number is removed, the token expires can be successfully redirected to the login page, but after the-sharp number is removed, the API request 401, that is, after the token expires, the jump page is successful but blank because of an error in parsing the css file path.
error content
the code in my main.js is
axios.interceptors.response.use (response = > {
return response
}, err = > {
if (err.response) {
switch (err.response.status) {
case 401:
router.replace({
path: "/login",
name: "login"
})
}
}
return Promise.reject (err.response.data)
})
token adds a code
this.$http.defaults.headers.common ["Authorization"] =" Bearer"+ res.data
when logging in, so does anyone know how to solve it?