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

chore: uni.getProvider providers.isAppExist

上级 8a5c617a
...@@ -4,7 +4,7 @@ import { ...@@ -4,7 +4,7 @@ import {
import { isFn, isPlainObject } from 'uni-shared' import { isFn, isPlainObject } from 'uni-shared'
const providers = { const providers = {
oauth (callback) { oauth(callback) {
plus.oauth.getServices(services => { plus.oauth.getServices(services => {
const provider = [] const provider = []
services.forEach(({ services.forEach(({
...@@ -17,7 +17,7 @@ const providers = { ...@@ -17,7 +17,7 @@ const providers = {
callback(err) callback(err)
}) })
}, },
share (callback) { share(callback) {
plus.share.getServices(services => { plus.share.getServices(services => {
const provider = [] const provider = []
services.forEach(({ services.forEach(({
...@@ -30,7 +30,7 @@ const providers = { ...@@ -30,7 +30,7 @@ const providers = {
callback(err) callback(err)
}) })
}, },
payment (callback) { payment(callback) {
plus.payment.getChannels(services => { plus.payment.getChannels(services => {
const provider = [] const provider = []
services.forEach(({ services.forEach(({
...@@ -43,7 +43,7 @@ const providers = { ...@@ -43,7 +43,7 @@ const providers = {
callback(err) callback(err)
}) })
}, },
push (callback) { push(callback) {
if (typeof weex !== 'undefined' || typeof plus !== 'undefined') { if (typeof weex !== 'undefined' || typeof plus !== 'undefined') {
const clientInfo = plus.push.getClientInfo() const clientInfo = plus.push.getClientInfo()
callback(null, [clientInfo.id], [clientInfo]) callback(null, [clientInfo.id], [clientInfo])
...@@ -53,7 +53,7 @@ const providers = { ...@@ -53,7 +53,7 @@ const providers = {
} }
} }
export function getProvider ({ export function getProvider({
service service
}, callbackId) { }, callbackId) {
if (providers[service]) { if (providers[service]) {
...@@ -74,7 +74,11 @@ export function getProvider ({ ...@@ -74,7 +74,11 @@ export function getProvider ({
if (Object.hasOwnProperty.call(provider, key)) { if (Object.hasOwnProperty.call(provider, key)) {
const item = provider[key] const item = provider[key]
if (!isFn(item) && typeof item !== 'undefined') { 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.
先完成此消息的编辑!
想要评论请 注册