From cba404592ae4a3836a0f33f613c1481d45f65a83 Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Tue, 9 Jun 2020 15:21:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DcompressImage=E5=9C=A8?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=AE=9D=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=8A=A5?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/platforms/mp-alipay/runtime/api/protocols.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/platforms/mp-alipay/runtime/api/protocols.js b/src/platforms/mp-alipay/runtime/api/protocols.js index bd588d9e..1ee7cc13 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: { -- GitLab