wx.uploadFile
调试基础库 2.25.3
问题很严重 ,每天都用用户反馈上传成功,但是后台看不到数据。ios 比较多 android 也有,我看之前也有很多人遇到,但是你们好像一直都没有解决,请重视此问题。
wx.chooseMedia({
count: 1,
mediaType: ['image', 'video'],
sourceType: ['album', 'camera'],
sizeType:['compressed'],
maxDuration: 30,
camera: 'back',
success(res) {
console.log(res.tempFiles.tempFilePath)
console.log(res.tempFiles.tempFilePath)
if (params == 0) {
var nextParams = {
path: res.tempFiles[0].tempFilePath,
type: 'idCardPic'
}
list.push(nextParams);
that.setData({
uploadIdFront: true,
idFrontPath: res.tempFiles[0].tempFilePath,
upLoadData: list,
})
} else if (params == 1) {
var nextParams = {
path: res.tempFiles[0].tempFilePath,
type: 'idCardBackPic'
}
list.push(nextParams);
that.setData({
uploadIdReverse: true,
idReversePath: res.tempFiles[0].tempFilePath,
upLoadData: list,
})
} else if (params == 2) {
var nextParams = {
path: res.tempFiles[0].tempFilePath,
type: 'personPic'
}
list.push(nextParams);
that.setData({
uploadIdHandHeld: true,
idHandHeldPath: res.tempFiles[0].tempFilePath,
upLoadData: list,
})
}
}
})
},
confirm() {
this.upLoadPic(this.data.upLoadData[0])
},
upLoadPic(params) {
var that = this
wx.uploadFile({
url: HOST_PATH + '/member/auth/mini',
filePath: params.path,
name: 'file',
formData: {
'requestNo': util.getRandomNum(),
'token': wx.getStorageSync(TOKEN),
'realName': this.data.userName,
'idCard': this.data.userId,
'type': params.type
},
success(res) {
console.log(res)
if (params.type == 'idCardPic') {
that.upLoadPic(that.data.upLoadData[1])
} else if (params.type == 'idCardBackPic') {
that.upLoadPic(that.data.upLoadData[2])
} else if (params.type == 'personPic') {
wx.hideLoading();
wx.showModal({
title: '提示',
content: '上传成功,请耐心等待审核结果',
showCancel: false,
complete: (res) => {
wx.navigateBack({ //返回上个页面
})
}
})
}
},
fail(e) {
wx.showToast({
title: e,
icon: 'none',
})
}
})
},
给个复现案例看看呢?
来人啊啊啊啊啊啊啊啊啊