<button class="avatar-wrapper bg" style="opacity: 0;" open-type="chooseAvatar"
@chooseavatar="onChooseAvatar">
onChooseAvatar(e) {
console.log('头像e', e);
const {
avatarUrl
} = e.detail
console.log("avatarUrl",avatarUrl);
uni.uploadFile({
url: 'uploadpic', //仅为示例,非真实的接口地址
filePath: avatarUrl,
name: 'file',
formData: {
'user': 'test111'
},
success: (uploadFileRes) => {
console.log(uploadFileRes.data);
}
});
this.userinfo['avatar'] = avatarUrl;
},
报错了uploadFile:fail createUploadTask:fail invalid url 这个临时路径没错呀 为什么会报错
1条答案
按热度按时间jmp7cifd1#
这个路径是什么?