axios拦截器 解决用户过了一段时间就需要重新登陆优化代码的方案 在main.js里面写入axios拦截器 引入拦截器 // 添加响应拦截器 axios.interceptors.response.use(function (response) { // 对响应数据做点什么 return response; }, function (error)