diff --git a/src/platforms/mp-alipay/runtime/api/protocols.js b/src/platforms/mp-alipay/runtime/api/protocols.js index bd588d9ee45d4ec1f8236cdaedf4a9e2bdc58801..1ee7cc1323257e95bc2c042d5548500acfd23be2 100644 --- a/src/platforms/mp-alipay/runtime/api/protocols.js +++ b/src/platforms/mp-alipay/runtime/api/protocols.js @@ -224,6 +224,20 @@ const protocols = { // 需要做转换的 API 列表 filePath: 'apFilePath' } }, + compressImage: { + args (fromArgs) { + fromArgs.compressLevel = 4 + if (fromArgs && fromArgs.quality) { + fromArgs.compressLevel = Math.floor(fromArgs.quality / 26) + } + fromArgs.apFilePaths = [fromArgs.src] + }, + returnValue (result) { + if (result.apFilePaths && result.apFilePaths.length) { + result.tempFilePath = result.apFilePaths[0] + } + } + }, chooseVideo: { // 支付宝小程序文档中未找到(仅在getSetting处提及),但实际可用 returnValue: {