Skip to content

Commit

Permalink
feat(mp-weixin): uni.compressImage parameter compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
StrivingRabbit committed Jan 30, 2023
1 parent 8a874fa commit 82d4038
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/platforms/mp-weixin/runtime/api/protocols.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ import getDeviceInfo from '../../helpers/get-device-info'
import getWindowInfo from '../../helpers/get-window-info'
import getAppAuthorizeSetting from '../../helpers/get-app-authorize-setting'

const compressImage = {
args (fromArgs) {
// https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
fromArgs.compressHeight = fromArgs.compressedHeight
}
if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
fromArgs.compressWidth = fromArgs.compressedWidth
}
}
}

export const protocols = {
redirectTo,
// navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
Expand All @@ -18,7 +30,8 @@ export const protocols = {
getAppBaseInfo,
getDeviceInfo,
getWindowInfo,
getAppAuthorizeSetting
getAppAuthorizeSetting,
compressImage
}
export const todos = [
'vibrate',
Expand Down

0 comments on commit 82d4038

Please sign in to comment.