可以通过在Axios请求的头部添加"Cache-Control"字段并设置其为"no-cache"的方式来禁用缓存。
示例代码如下:
axios({ method: "GET", url: "http://example.com/api/", headers: { "Cache-Control": "no-cache" } }) .then(response => { console.log(response); }) .catch(error => { console.error(error); });