import queryString from 'query-string';
fetch 参数如下,
1.需要设置content-type application/x-www-form-urlencoded
2.body 进行param 转化为a=1&b=2 的形式
则提交到服务端的内容与post内容相同
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
method: "POST",
body: queryString.stringify(data)
参考文档https://stackoverflow.com/questions/29775797/fetch-post-json-data