let that = this;
// console.log(list[index]);
uni.uploadFile({
url: '***',// api地址
filePath: list[index].url, // 本地上传完成后的路径
name: 'file', // 默认
// header: {
//  "Content-Type": "multipart/form-data", // formdata提交格式
// },
// formData: {  // 其他的formdata参数
//  fileType: '2',
//  fileContainerName: 'default'
//  // file: list[index].file
// },
success: function(res) {
// console.log(res);
if(res.statusCode == 200){
var result = JSON.parse(res.data)
that.model.image = result.data.fullurl;
console.log(that.model);
}
}
});
 
                                        
                                    
                                    
                                        1***@163.com                                                                                
                                        
                                - 发布:2021-04-07 12:07
- 更新:2022-03-10 20:52
- 阅读:1978
 
             
             
             
			 
                                                                     
                                                                     
                                                                     
            
DCloud_Android_ST
可以先保存到应用沙盒路径,然后再上传
uni.chooseImage({
success: function (res) {
var tempFilePaths = res.tempFilePaths;
uni.saveFile({
tempFilePath: tempFilePaths[0],
success: function (res) {
var savedFilePath = res.savedFilePath;
}
});
}
});
2021-10-26 18:20
z***@163.com
回复 DCloud_Android_ST: 解决了老铁,就是路径不支持拼接的形式
2021-10-26 19:28