wx.uploadFile({
url: id ? url + id : url,
filePath: path,
name: filename,
formData: data,
success(res) {
console.log(“test”, “1”)
wx.hideLoading()
console.log(“test”, res)
if (res.statusCode === 200) {
resolve(res.data)
setTimeout(() => {
wx.hideToast();
}, 300)
} else if (res.data.code === 401) {
reject(res.data)
wx.showModal({
title: ‘提示’,
content: ‘未认证或认证过期,请重新登录’,
showCancel: false,
success() {
wx.navigateTo({
url: ‘/pages/login00/sign’,
})
}
});
} else {
console.log(“huafengyierror”, res)
reject(res.data)
wx.showModal({
title: ‘提示’,
content: res.data.msg ? res.data.msg : res.data.content ? res.data.content : ‘当前网络不稳定,请稍后再试’,
showCancel: false
});
}
}
})
返回的statusCode != 200 时,iphone7 iphone7p直接崩溃