shmily138
shmily138
  • 发布:2020-10-19 17:09
  • 更新:2020-11-04 20:55
  • 阅读:1494

【报Bug】iOS端saveImageToPhotosAlbum保存带中文字符的图片地址不进成功回调

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: Windows 10 专业版,版本号1809,操作系统版本:17763.1282

HBuilderX类型: 正式

HBuilderX版本号: 2.9.3

手机系统: iOS

手机系统版本号: iOS 13.4

手机厂商: 苹果

手机机型: iphone SE

页面类型: vue

打包方式: 云端

项目创建方式: HBuilderX

示例代码:
                                // url = 'https://img-cdn-qiniu.dcloud.net.cn/uniapp/doc/uniapp4@2x.png';  
                // url = 'http://www.html5plus.org/images/material.png';  
                url = 'http://192.168.0.110:9200/static/测试.png';  
                uni.downloadFile({  
                    url: url,  
                    success: (res) => {  
                        console.log(res)  
                        if (res.statusCode === 200) {  
                            uni.saveImageToPhotosAlbum({  
                                filePath: res.tempFilePath,  
                                success: (resq) => {  
                                    uni.hideLoading({})  
                                    uni.showToast({  
                                        title: '下载成功',  
                                        icon: 'none'  
                                    })  
                                },  
                                fail: (resq) => {  
                                    console.log(resq)  
                                    uni.hideLoading()  
                                    uni.showToast({  
                                        title: '下载失败',  
                                        icon: 'none'  
                                    })  
                                }  
                            })  
                        }else {  
                            uni.hideLoading()  
                            uni.showToast({  
                                title: '下载失败',  
                                icon: 'none'  
                            })  
                        }  
                    },  
                    fail:err => {  
                        console.log(err);  
                        uni.hideLoading()  
                        uni.showToast({  
                            title: '下载失败',  
                            icon: 'none'  
                        })  
                    }  
                })

操作步骤:

1.网络图片地址中包含中文字符
2.uni.downloadFile ==> success
3.uni.saveImageToPhotosAlbum ===> fail

预期结果:

进入success回调

实际结果:

进入fail回调:"errMsg": "saveImageToPhotosAlbum:fail"

bug描述:

iOS版本13.6.1
saveImageToPhotosAlbum保存带中文字符的图片地址不进成功回调
1.网络图片地址中包含中文字符,先使用uni.downloadFile成功下载为了临时文件,输出临时文件路径发现也包含中文字符

  1. 再使用uni.saveImageToPhotosAlbum保存到相册,不进成功回调,一直进fail回调:"errMsg": "saveImageToPhotosAlbum:fail"
    3.安卓环境未发现上述现象
2020-10-19 17:09 负责人:DCloud_iOS_XHY 分享
已邀请:

最佳回复

DCloud_iOS_XHY

DCloud_iOS_XHY

感谢反馈,HX 2.9.6 + 版本已修复此问题

shmily138

shmily138 (作者)

有人吗,官方能回复一下吗?

shmily138

shmily138 (作者)

求回复啊

shmily138

shmily138 (作者)

就不能回复一下吗?

该问题目前已经被锁定, 无法添加新回复