let url = this.$store.state.imgurl
url= url + `File/xcx/uploadingShareUrlFile?userId=${this.USERID}&type=0&proId=${this.productDetail.id}`
wx.uploadFile({
url:url, // Replace with your API endpoint
filePath: filePath,
name: 'multipartFile', // Name of the field that your server expects
success(res) {
console.log('Upload successful:', res.data);
// Handle your success logic here
},
fail(err) {
console.error('Error uploading file:', err);
// Handle your error logic here
}
});
formdata上传文件给后端
最新推荐文章于 2024-07-24 23:00:08 发布