我尝试了使用如下代码
getgroup() { this.setState({code: null}); axios({ baseURL: 'http://172.31.0.110:7999/v1.0/gogamechen1/groups', method: 'POST', headers: {'content-type': 'application/json'}, timeout: 5000, params: { _method: 'GET' }, data: { desc: true, }, httpAgent: new http.Agent({ keepAlive: false }), }) .then(this.handleResult) .catch(this.handError); }; 但是没有效果,还是 keep alive 的 axios 里如何主动关闭连接啊
js 的库是不是都喜欢隐藏这些细节啊, 有需求的时候都找不到在哪设 orz
