editPhotoAc() {
var that = this
uni.chooseImage({
count: 1,
success: (chooseImageRes) => {
uni.showLoading({})
const tempFilePaths = chooseImageRes.tempFilePaths;
uni.uploadFile({
url: this.$baseUrl + '/api/common/upload',
filePath: tempFilePaths[0],
name: 'file',
success: (uploadFileRes) => {
console.log(uploadFileRes)
let data = JSON.parse(uploadFileRes.data)
that.userInfo.avatar = data.data.fullurl
uni.hideLoading()
},
fail: (err) => {
uni.showModal({
content: JSON.stringify(err),
success: (res) => {
}
})
uni.hideLoading();
},
});
}
});
},

- 发布:2025-07-18 15:44
- 更新:2025-07-18 15:47
- 阅读:470
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: Windows 10
HBuilderX类型: 正式
HBuilderX版本号: 4.66
手机系统: Android
手机系统版本号: Android 14
手机厂商: 三星
手机机型: SM-A145R
页面类型: vue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
使用uni.chooseImage上传图片,打好apk包后,在三星手机上传图片失败,会提示"errMsg": "uploadFile:fail undefined",在其他类型手机上则可以正常使用
使用uni.chooseImage上传图片,打好apk包后,在三星手机上传图片失败,会提示"errMsg": "uploadFile:fail undefined",在其他类型手机上则可以正常使用
预期结果:
在三星手机上可以正常上传图片
在三星手机上可以正常上传图片
实际结果:
在三星手机上无法正常上传图片
在三星手机上无法正常上传图片
bug描述:
在三星手机使用apk包,安装的应用在上传图片会报错误"errMsg": "uploadFile:fail undefined"。但是在使用真机运行时,无论是标准基座还是自定义基座均没有问题。而且同一个apk包,在华为、小米等类型的手机上均没有问题,仅仅是三星手机有该问题
1 个回复
1***@163.com (作者)
报错图片