在axios中设置withCredentials为true解决该问题。示例代码如下:
axios.get('http://example.com', { withCredentials: true })
或者,您可以将axios.defaults.withCredentials设置为true:
axios.defaults.withCredentials = true; axios.get('http://example.com');
上一篇:AXIOS请求中出现未知类型的捕获错误
下一篇:axios请求重试失败:无法读取未定义的“cancelToken”属性。