提交 688021bf 编写于 作者: D DCloud_LXH

chore: uni.getProvider providers.isAppExist

上级 8a5c617a
......@@ -4,7 +4,7 @@ import {
import { isFn, isPlainObject } from 'uni-shared'
const providers = {
oauth (callback) {
oauth(callback) {
plus.oauth.getServices(services => {
const provider = []
services.forEach(({
......@@ -17,7 +17,7 @@ const providers = {
callback(err)
})
},
share (callback) {
share(callback) {
plus.share.getServices(services => {
const provider = []
services.forEach(({
......@@ -30,7 +30,7 @@ const providers = {
callback(err)
})
},
payment (callback) {
payment(callback) {
plus.payment.getChannels(services => {
const provider = []
services.forEach(({
......@@ -43,7 +43,7 @@ const providers = {
callback(err)
})
},
push (callback) {
push(callback) {
if (typeof weex !== 'undefined' || typeof plus !== 'undefined') {
const clientInfo = plus.push.getClientInfo()
callback(null, [clientInfo.id], [clientInfo])
......@@ -53,7 +53,7 @@ const providers = {
}
}
export function getProvider ({
export function getProvider({
service
}, callbackId) {
if (providers[service]) {
......@@ -74,7 +74,11 @@ export function getProvider ({
if (Object.hasOwnProperty.call(provider, key)) {
const item = provider[key]
if (!isFn(item) && typeof item !== 'undefined') {
returnProvider[key] = item
const _key =
key === 'nativeClient' || key === 'serviceReady'
? 'isAppExist'
: key
returnProvider[_key] = item
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册