uni.saveFile({
tempFilePath: re.tempFilePath,
success: function(res2) {
console.log(res2)
var savedFilePath = res2.savedFilePath;
let obj = {
filePath: savedFilePath,
fileSize: res.size
}
that.uploadAndSaveInfo(obj, function(res) {
console.log(res)
if (res && res.code == 1) {
setTimeout(that.getFileListSql(), 100)
}
})
},
fail:function(err){
console.log(err)
}
});

- 发布:2024-12-05 17:18
- 更新:2024-12-05 22:40
- 阅读:212
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: 23H2
HBuilderX类型: 正式
HBuilderX版本号: 4.36
手机系统: iOS
手机系统版本号: iOS 16
手机厂商: 苹果
手机机型: 苹果13proMAX
页面类型: vue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
ios调用uni.saveFile
ios调用uni.saveFile
预期结果:
正常success
正常success
实际结果:
{
"errMsg": "saveFile:fail 不允许读",
"errCode": 4,
"code": 4
}
{
"errMsg": "saveFile:fail 不允许读",
"errCode": 4,
"code": 4
}
bug描述:
苹果调用uni.saveFile时报错
{
"errMsg": "saveFile:fail 不允许读",
"errCode": 4,
"code": 4
}
1 个回复
锦鲤_接单 - 锦鲤_接单_18560000860_10+年开发经验
应该先判断是否有读写的权限吧