提交 723195de 编写于 作者: D DCloud_LXH

fix: 兼容 支付宝在开发者工具中没有tempFiles属性

上级 d4437d35
import {
isPlainObject
isPlainObject,
hasOwn
} from 'uni-shared'
import navigateTo from 'uni-helpers/navigate-to'
import redirectTo from '../../../mp-weixin/helpers/redirect-to'
......@@ -251,8 +252,17 @@ const protocols = { // 需要做转换的 API 列表
// TODO 有没有返回值还需要测试下
},
chooseImage: {
returnValue: {
apFilePaths: 'tempFilePaths'
returnValue (result) {
const hasTempFilePaths = hasOwn(result,'tempFilePaths') && result.tempFilePaths
if (hasOwn(result,'apFilePaths') && !hasTempFilePaths) {
result.tempFilePaths = result.apFilePaths
delete result.apFilePaths
}
if (!hasOwn(result,'tempFiles') && hasTempFilePaths) {
result.tempFiles = []
result.tempFilePaths.forEach(tempFilePath => result.tempFiles.push({path: tempFilePath}))
}
return {}
}
},
previewImage: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册