使用以下代码:
const apis = { ...wx, ...otherAPIs }
或以下代码
const apis = Object.assign(otherAPIs, wx)
会导致在SDK 2.12.1内打开时报错:
MiniProgramError
Error: APP-SERVICE-SDK:quicklyAddBrandContact:fail rejected due to no permission currently
Error: APP-SERVICE-SDK:quicklyAddBrandContact:fail rejected due to no permission currently
at Object.quicklyAddBrandContact (https://lib/WASubContext.js:2:1722798)
at assign ()
at https://usr/app-service.js:21544:928
at require (https://lib/WASubContext.js:2:2042620)
at https://lib/WASubContext.js:2:2041993
at https://usr/app-service.js:22036:65
at require (https://lib/WASubContext.js:2:2042620)
at https://usr/app-service.js:22037:10
但是也无法将代码改为:
const apis = Object.assign(wx, otherAPIs)
因为这个会在有使用了插件内的小程序内报错
https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html