https://hbiao68.blog.csdn.net/article/details/106004100
‘Content-Type’: ‘application/json’ 请求
将数据转为 key=value 的形式
import qs from 'qs'
http({
method: 'post',
url: 'http://127.0.0.1:10111/login',
data: qs.stringify(data)
})
‘Content-Type’: ‘application/x-www-form-urlencoded’ 请求
将数据转为 key=value 的形式
import qs from 'qs'
http({
method: 'post',
url: 'http://127.0.0.1:10111/login',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data: qs.stringify(data)
})