export default fetch = (url, data = {}, method, headers, timeout) => {
return new Promise((resolve, reject) => {
wx.getStorage({
key: ‘baseUrl’,
success: (res) => {
//发送请求
wx.request({
url: `${res.data}${url}`,
data: data,
method: method,
header: headers,
timeout: timeout,
success: res => {
resolve(res)
let warning = res.data.HttpMessage
if (warning == ‘身份验证失败,拒绝访问’) {
wx.hideLoading();
wx.showModal({
title: ‘提示’,
content: ‘身份验证失败,是否重新登录?’,
confirmText: “确认”,
cancelText: “取消”,
success: (res) => {
if (res.confirm) {
wx.redirectTo({
url: ‘pages/logs/logs’
});
} else if (res.cancel) {
}
}
});
}
},
fail: (err) => {
reject(err);
console.log(err)
},
complete: (res) => {
// wx.hideLoading()
}
})
}
})
})
}
不支持吗,开发正常,最近又有更新吗,上线就不行了