uni-app 报错

l7mqbcuq  于 4个月前  发布在  uni-app
关注(0)|答案(1)|浏览(58)
<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 这个临时路径没错呀 为什么会报错

相关问题