Skip to content

Commit

Permalink
fix(alipay/swan): 支付宝 && 百度小程序 api 不支持提示
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Nov 7, 2018
1 parent 9127a2a commit 286f0e3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/taro-alipay/src/native-api.js
Expand Up @@ -226,6 +226,12 @@ function request (options) {
function processApis (taro) {
const weApis = Object.assign({ }, onAndSyncApis, noPromiseApis, otherApis)
Object.keys(weApis).forEach(key => {
if (!(key in my)) {
taro[key] = () => {
console.warn(`支付宝小程序暂不支持 ${key}`)
}
return
}
if (!onAndSyncApis[key] && !noPromiseApis[key]) {
taro[key] = (options, ...args) => {
const result = generateSpecialApis(key, options || {})
Expand Down
6 changes: 6 additions & 0 deletions packages/taro-swan/src/native-api.js
Expand Up @@ -65,6 +65,12 @@ function request (options) {
function processApis (taro) {
const weApis = Object.assign({ }, onAndSyncApis, noPromiseApis, otherApis)
Object.keys(weApis).forEach(key => {
if (!(key in my)) {
taro[key] = () => {
console.warn(`百度小程序暂不支持 ${key}`)
}
return
}
if (!onAndSyncApis[key] && !noPromiseApis[key]) {
taro[key] = (options, ...args) => {
options = options || {}
Expand Down

0 comments on commit 286f0e3

Please sign in to comment.