axios请求header中添加'Pragma':'no-cache'。
永久性解决方法是在axios配置添加这个参数,比如:
const config = {
headers: { Pragma: 'no-cache'},
params: { id: this.state.taskID }
}
// 或者这样写也可以
config.headers['Pragma'] = 'no-cache'
axios.get(url, config).then(...)
const config = {
headers: { Pragma: 'no-cache'},
params: { id: this.state.taskID }
}
// 或者这样写也可以
config.headers['Pragma'] = 'no-cache'
axios.get(url, config).then(...)