错误如下:
解决方案:
对 axios.defaults.adapter
进行封装:
axios.defaults.adapter = function (config) {
return new Promise((resolve, reject) => {
my.request({
url: config.url,
headers: config.headers,
method: 'POST',
data: config.data,
dataType: 'text',
success: function (res) {
resolve(res)
},
fail: function (res) {
reject(res)
}
});
})
}