Permalink
Browse files

fix(alipay): 支付宝小程序 api 不支持提示逻辑错误

  • Loading branch information...
luckyadam committed Nov 8, 2018
1 parent 721ebf4 commit 84b05ae3e1b6631a8b13741ab26e62b8255908d8
Showing with 8 additions and 6 deletions.
  1. +8 −6 packages/taro-alipay/src/native-api.js
@@ -226,19 +226,17 @@ 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 || {})
const newKey = result.api
options = result.options
let task = null
let obj = Object.assign({}, options)
if (!(newKey in my)) {
console.warn(`支付宝小程序暂不支持 ${newKey}`)
return
}
if (typeof options === 'string') {
if (args.length) {
return my[newKey](options, ...args)
@@ -290,6 +288,10 @@ function processApis (taro) {
}
} else {
taro[key] = (...args) => {
if (!(key in my)) {
console.warn(`支付宝小程序暂不支持 ${key}`)
return
}
if (key === 'getStorageSync') {
const arg1 = args[0]
if (arg1 != null) {

0 comments on commit 84b05ae

Please sign in to comment.