Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
genary
uni-app
提交
8791df6e
U
uni-app
项目概览
genary
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8791df6e
编写于
6月 22, 2022
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: build
上级
8618a160
变更
15
展开全部
隐藏空白更改
内联
并排
Showing
15 changed file
with
339 addition
and
225 deletion
+339
-225
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+32
-22
packages/uni-h5/dist/index.umd.min.js
packages/uni-h5/dist/index.umd.min.js
+1
-1
packages/uni-h5/manifest.json
packages/uni-h5/manifest.json
+4
-0
packages/uni-mp-alipay/dist/index.js
packages/uni-mp-alipay/dist/index.js
+30
-20
packages/uni-mp-baidu/dist/index.js
packages/uni-mp-baidu/dist/index.js
+30
-20
packages/uni-mp-jd/dist/index.js
packages/uni-mp-jd/dist/index.js
+30
-20
packages/uni-mp-kuaishou/dist/index.js
packages/uni-mp-kuaishou/dist/index.js
+30
-20
packages/uni-mp-lark/dist/index.js
packages/uni-mp-lark/dist/index.js
+30
-20
packages/uni-mp-qq/dist/index.js
packages/uni-mp-qq/dist/index.js
+30
-20
packages/uni-mp-toutiao/dist/index.js
packages/uni-mp-toutiao/dist/index.js
+30
-20
packages/uni-mp-weixin/dist/index.js
packages/uni-mp-weixin/dist/index.js
+30
-20
packages/uni-mp-xhs/dist/index.js
packages/uni-mp-xhs/dist/index.js
+30
-20
packages/uni-quickapp-native/dist/vue.dev.js
packages/uni-quickapp-native/dist/vue.dev.js
+1
-1
packages/uni-quickapp-native/dist/vue.prod.js
packages/uni-quickapp-native/dist/vue.prod.js
+1
-1
packages/uni-quickapp-webview/dist/index.js
packages/uni-quickapp-webview/dist/index.js
+30
-20
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
8791df6e
...
...
@@ -276,7 +276,7 @@ var serviceContext = (function () {
const plugin = [
'invokePushCallback',
'getPushC
i
d',
'getPushC
lientI
d',
'onPushMessage',
'offPushMessage',
];
...
...
@@ -3787,7 +3787,7 @@ var serviceContext = (function () {
}
}
// 部分 API 直接实现
const unwrappers = ['getPushClient
i
d', 'onPushMessage', 'offPushMessage'];
const unwrappers = ['getPushClient
I
d', 'onPushMessage', 'offPushMessage'];
function wrapper (name, invokeMethod, extras = {}) {
if (unwrappers.indexOf(name) > -1 || !isFn(invokeMethod)) {
...
...
@@ -21289,6 +21289,7 @@ var serviceContext = (function () {
let cid;
let cidErrMsg;
let enabled;
function normalizePushMessage (message) {
try {
...
...
@@ -21300,7 +21301,9 @@ var serviceContext = (function () {
function invokePushCallback (
args
) {
if (args.type === 'clientId') {
if (args.type === 'enabled') {
enabled = true;
} else if (args.type === 'clientId') {
cid = args.cid;
cidErrMsg = args.errMsg;
invokeGetPushCidCallbacks(cid, args.errMsg);
...
...
@@ -21330,7 +21333,7 @@ var serviceContext = (function () {
getPushCidCallbacks.length = 0;
}
function getPushClient
i
d (args) {
function getPushClient
I
d (args) {
if (!isPlainObject(args)) {
args = {};
}
...
...
@@ -21342,25 +21345,32 @@ var serviceContext = (function () {
const hasSuccess = isFn(success);
const hasFail = isFn(fail);
const hasComplete = isFn(complete);
getPushCidCallbacks.push((cid, errMsg) => {
let res;
if (cid) {
res = {
errMsg: 'getPushClientid:ok',
cid
};
hasSuccess && success(res);
} else {
res = {
errMsg: 'getPushClientid:fail' + (errMsg ? ' ' + errMsg : '')
};
hasFail && fail(res);
Promise.resolve().then(() => {
if (typeof enabled === 'undefined') {
enabled = false;
cid = '';
cidErrMsg = 'unipush is not enabled';
}
getPushCidCallbacks.push((cid, errMsg) => {
let res;
if (cid) {
res = {
errMsg: 'getPushClientId:ok',
cid
};
hasSuccess && success(res);
} else {
res = {
errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
};
hasFail && fail(res);
}
hasComplete && complete(res);
});
if (typeof cid !== 'undefined') {
invokeGetPushCidCallbacks(cid, cidErrMsg);
}
hasComplete && complete(res);
});
if (typeof cid !== 'undefined') {
Promise.resolve().then(() => invokeGetPushCidCallbacks(cid, cidErrMsg));
}
}
const onPushMessageCallbacks = [];
...
...
@@ -21385,7 +21395,7 @@ var serviceContext = (function () {
var require_context_module_1_22 = /*#__PURE__*/Object.freeze({
__proto__: null,
invokePushCallback: invokePushCallback,
getPushClient
id: getPushClienti
d,
getPushClient
Id: getPushClientI
d,
onPushMessage: onPushMessage,
offPushMessage: offPushMessage
});
...
...
packages/uni-h5/dist/index.umd.min.js
浏览文件 @
8791df6e
此差异已折叠。
点击以展开。
packages/uni-h5/manifest.json
浏览文件 @
8791df6e
...
...
@@ -1015,6 +1015,10 @@
"/core/service/api/plugin/push.js"
,
[]
],
"getPushClientId"
:
[
"/core/service/api/plugin/push.js"
,
[]
],
"onPushMessage"
:
[
"/core/service/api/plugin/push.js"
,
[]
...
...
packages/uni-mp-alipay/dist/index.js
浏览文件 @
8791df6e
...
...
@@ -1720,6 +1720,7 @@ function getApiCallbacks (params) {
let
cid
;
let
cidErrMsg
;
let
enabled
;
function
normalizePushMessage
(
message
)
{
try
{
...
...
@@ -1731,7 +1732,9 @@ function normalizePushMessage (message) {
function
invokePushCallback
(
args
)
{
if
(
args
.
type
===
'
clientId
'
)
{
if
(
args
.
type
===
'
enabled
'
)
{
enabled
=
true
;
}
else
if
(
args
.
type
===
'
clientId
'
)
{
cid
=
args
.
cid
;
cidErrMsg
=
args
.
errMsg
;
invokeGetPushCidCallbacks
(
cid
,
args
.
errMsg
);
...
...
@@ -1761,7 +1764,7 @@ function invokeGetPushCidCallbacks (cid, errMsg) {
getPushCidCallbacks
.
length
=
0
;
}
function
getPushClient
i
d
(
args
)
{
function
getPushClient
I
d
(
args
)
{
if
(
!
isPlainObject
(
args
))
{
args
=
{};
}
...
...
@@ -1773,25 +1776,32 @@ function getPushClientid (args) {
const
hasSuccess
=
isFn
(
success
);
const
hasFail
=
isFn
(
fail
);
const
hasComplete
=
isFn
(
complete
);
getPushCidCallbacks
.
push
((
cid
,
errMsg
)
=>
{
let
res
;
if
(
cid
)
{
res
=
{
errMsg
:
'
getPushClientid:ok
'
,
cid
};
hasSuccess
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getPushClientid:fail
'
+
(
errMsg
?
'
'
+
errMsg
:
''
)
};
hasFail
&&
fail
(
res
);
Promise
.
resolve
().
then
(()
=>
{
if
(
typeof
enabled
===
'
undefined
'
)
{
enabled
=
false
;
cid
=
''
;
cidErrMsg
=
'
unipush is not enabled
'
;
}
getPushCidCallbacks
.
push
((
cid
,
errMsg
)
=>
{
let
res
;
if
(
cid
)
{
res
=
{
errMsg
:
'
getPushClientId:ok
'
,
cid
};
hasSuccess
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getPushClientId:fail
'
+
(
errMsg
?
'
'
+
errMsg
:
''
)
};
hasFail
&&
fail
(
res
);
}
hasComplete
&&
complete
(
res
);
});
if
(
typeof
cid
!==
'
undefined
'
)
{
invokeGetPushCidCallbacks
(
cid
,
cidErrMsg
);
}
hasComplete
&&
complete
(
res
);
});
if
(
typeof
cid
!==
'
undefined
'
)
{
Promise
.
resolve
().
then
(()
=>
invokeGetPushCidCallbacks
(
cid
,
cidErrMsg
));
}
}
const
onPushMessageCallbacks
=
[];
...
...
@@ -1909,7 +1919,7 @@ var api = /*#__PURE__*/Object.freeze({
setStorageSync
:
setStorageSync
,
getStorageSync
:
getStorageSync
,
removeStorageSync
:
removeStorageSync
,
getPushClient
id
:
getPushClienti
d
,
getPushClient
Id
:
getPushClientI
d
,
onPushMessage
:
onPushMessage
,
offPushMessage
:
offPushMessage
,
invokePushCallback
:
invokePushCallback
...
...
packages/uni-mp-baidu/dist/index.js
浏览文件 @
8791df6e
...
...
@@ -1362,6 +1362,7 @@ function getApiCallbacks (params) {
let
cid
;
let
cidErrMsg
;
let
enabled
;
function
normalizePushMessage
(
message
)
{
try
{
...
...
@@ -1373,7 +1374,9 @@ function normalizePushMessage (message) {
function
invokePushCallback
(
args
)
{
if
(
args
.
type
===
'
clientId
'
)
{
if
(
args
.
type
===
'
enabled
'
)
{
enabled
=
true
;
}
else
if
(
args
.
type
===
'
clientId
'
)
{
cid
=
args
.
cid
;
cidErrMsg
=
args
.
errMsg
;
invokeGetPushCidCallbacks
(
cid
,
args
.
errMsg
);
...
...
@@ -1403,7 +1406,7 @@ function invokeGetPushCidCallbacks (cid, errMsg) {
getPushCidCallbacks
.
length
=
0
;
}
function
getPushClient
i
d
(
args
)
{
function
getPushClient
I
d
(
args
)
{
if
(
!
isPlainObject
(
args
))
{
args
=
{};
}
...
...
@@ -1415,25 +1418,32 @@ function getPushClientid (args) {
const
hasSuccess
=
isFn
(
success
);
const
hasFail
=
isFn
(
fail
);
const
hasComplete
=
isFn
(
complete
);
getPushCidCallbacks
.
push
((
cid
,
errMsg
)
=>
{
let
res
;
if
(
cid
)
{
res
=
{
errMsg
:
'
getPushClientid:ok
'
,
cid
};
hasSuccess
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getPushClientid:fail
'
+
(
errMsg
?
'
'
+
errMsg
:
''
)
};
hasFail
&&
fail
(
res
);
Promise
.
resolve
().
then
(()
=>
{
if
(
typeof
enabled
===
'
undefined
'
)
{
enabled
=
false
;
cid
=
''
;
cidErrMsg
=
'
unipush is not enabled
'
;
}
getPushCidCallbacks
.
push
((
cid
,
errMsg
)
=>
{
let
res
;
if
(
cid
)
{
res
=
{
errMsg
:
'
getPushClientId:ok
'
,
cid
};
hasSuccess
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getPushClientId:fail
'
+
(
errMsg
?
'
'
+
errMsg
:
''
)
};
hasFail
&&
fail
(
res
);
}
hasComplete
&&
complete
(
res
);
});
if
(
typeof
cid
!==
'
undefined
'
)
{
invokeGetPushCidCallbacks
(
cid
,
cidErrMsg
);
}
hasComplete
&&
complete
(
res
);
});
if
(
typeof
cid
!==
'
undefined
'
)
{
Promise
.
resolve
().
then
(()
=>
invokeGetPushCidCallbacks
(
cid
,
cidErrMsg
));
}
}
const
onPushMessageCallbacks
=
[];
...
...
@@ -1477,7 +1487,7 @@ var api = /*#__PURE__*/Object.freeze({
__proto__
:
null
,
requestPayment
:
requestPayment
,
createMediaQueryObserver
:
createMediaQueryObserver
,
getPushClient
id
:
getPushClienti
d
,
getPushClient
Id
:
getPushClientI
d
,
onPushMessage
:
onPushMessage
,
offPushMessage
:
offPushMessage
,
invokePushCallback
:
invokePushCallback
...
...
packages/uni-mp-jd/dist/index.js
浏览文件 @
8791df6e
...
...
@@ -999,6 +999,7 @@ function getApiCallbacks (params) {
let
cid
;
let
cidErrMsg
;
let
enabled
;
function
normalizePushMessage
(
message
)
{
try
{
...
...
@@ -1010,7 +1011,9 @@ function normalizePushMessage (message) {
function
invokePushCallback
(
args
)
{
if
(
args
.
type
===
'
clientId
'
)
{
if
(
args
.
type
===
'
enabled
'
)
{
enabled
=
true
;
}
else
if
(
args
.
type
===
'
clientId
'
)
{
cid
=
args
.
cid
;
cidErrMsg
=
args
.
errMsg
;
invokeGetPushCidCallbacks
(
cid
,
args
.
errMsg
);
...
...
@@ -1040,7 +1043,7 @@ function invokeGetPushCidCallbacks (cid, errMsg) {
getPushCidCallbacks
.
length
=
0
;
}
function
getPushClient
i
d
(
args
)
{
function
getPushClient
I
d
(
args
)
{
if
(
!
isPlainObject
(
args
))
{
args
=
{};
}
...
...
@@ -1052,25 +1055,32 @@ function getPushClientid (args) {
const
hasSuccess
=
isFn
(
success
);
const
hasFail
=
isFn
(
fail
);
const
hasComplete
=
isFn
(
complete
);
getPushCidCallbacks
.
push
((
cid
,
errMsg
)
=>
{
let
res
;
if
(
cid
)
{
res
=
{
errMsg
:
'
getPushClientid:ok
'
,
cid
};
hasSuccess
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getPushClientid:fail
'
+
(
errMsg
?
'
'
+
errMsg
:
''
)
};
hasFail
&&
fail
(
res
);
Promise
.
resolve
().
then
(()
=>
{
if
(
typeof
enabled
===
'
undefined
'
)
{
enabled
=
false
;
cid
=
''
;
cidErrMsg
=
'
unipush is not enabled
'
;
}
getPushCidCallbacks
.
push
((
cid
,
errMsg
)
=>
{
let
res
;
if
(
cid
)
{
res
=
{
errMsg
:
'
getPushClientId:ok
'
,
cid
};
hasSuccess
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getPushClientId:fail
'
+
(
errMsg
?
'
'
+
errMsg
:
''
)
};
hasFail
&&
fail
(
res
);
}
hasComplete
&&
complete
(
res
);
});
if
(
typeof
cid
!==
'
undefined
'
)
{
invokeGetPushCidCallbacks
(
cid
,
cidErrMsg
);
}
hasComplete
&&
complete
(
res
);
});
if
(
typeof
cid
!==
'
undefined
'
)
{
Promise
.
resolve
().
then
(()
=>
invokeGetPushCidCallbacks
(
cid
,
cidErrMsg
));
}
}
const
onPushMessageCallbacks
=
[];
...
...
@@ -1094,7 +1104,7 @@ const offPushMessage = (fn) => {
var
api
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
getPushClient
id
:
getPushClienti
d
,
getPushClient
Id
:
getPushClientI
d
,
onPushMessage
:
onPushMessage
,
offPushMessage
:
offPushMessage
,
invokePushCallback
:
invokePushCallback
...
...
packages/uni-mp-kuaishou/dist/index.js
浏览文件 @
8791df6e
...
...
@@ -1167,6 +1167,7 @@ function getApiCallbacks (params) {
let
cid
;
let
cidErrMsg
;
let
enabled
;
function
normalizePushMessage
(
message
)
{
try
{
...
...
@@ -1178,7 +1179,9 @@ function normalizePushMessage (message) {
function
invokePushCallback
(
args
)
{
if
(
args
.
type
===
'
clientId
'
)
{
if
(
args
.
type
===
'
enabled
'
)
{
enabled
=
true
;
}
else
if
(
args
.
type
===
'
clientId
'
)
{
cid
=
args
.
cid
;
cidErrMsg
=
args
.
errMsg
;
invokeGetPushCidCallbacks
(
cid
,
args
.
errMsg
);
...
...
@@ -1208,7 +1211,7 @@ function invokeGetPushCidCallbacks (cid, errMsg) {
getPushCidCallbacks
.
length
=
0
;
}
function
getPushClient
i
d
(
args
)
{
function
getPushClient
I
d
(
args
)
{
if
(
!
isPlainObject
(
args
))
{
args
=
{};
}
...
...
@@ -1220,25 +1223,32 @@ function getPushClientid (args) {
const
hasSuccess
=
isFn
(
success
);
const
hasFail
=
isFn
(
fail
);
const
hasComplete
=
isFn
(
complete
);
getPushCidCallbacks
.
push
((
cid
,
errMsg
)
=>
{
let
res
;
if
(
cid
)
{
res
=
{
errMsg
:
'
getPushClientid:ok
'
,
cid
};
hasSuccess
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getPushClientid:fail
'
+
(
errMsg
?
'
'
+
errMsg
:
''
)
};
hasFail
&&
fail
(
res
);
Promise
.
resolve
().
then
(()
=>
{
if
(
typeof
enabled
===
'
undefined
'
)
{
enabled
=
false
;
cid
=
''
;
cidErrMsg
=
'
unipush is not enabled
'
;
}
getPushCidCallbacks
.
push
((
cid
,
errMsg
)
=>
{
let
res
;
if
(
cid
)
{
res
=
{
errMsg
:
'
getPushClientId:ok
'
,
cid
};
hasSuccess
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getPushClientId:fail
'
+
(
errMsg
?
'
'
+
errMsg
:
''
)
};
hasFail
&&
fail
(
res
);
}
hasComplete
&&
complete
(
res
);
});
if
(
typeof
cid
!==
'
undefined
'
)
{
invokeGetPushCidCallbacks
(
cid
,
cidErrMsg
);
}
hasComplete
&&
complete
(
res
);
});
if
(
typeof
cid
!==
'
undefined
'
)
{
Promise
.
resolve
().
then
(()
=>
invokeGetPushCidCallbacks
(
cid
,
cidErrMsg
));
}
}
const
onPushMessageCallbacks
=
[];
...
...
@@ -1262,7 +1272,7 @@ const offPushMessage = (fn) => {
var
api
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
getPushClient
id
:
getPushClienti
d
,
getPushClient
Id
:
getPushClientI
d
,
onPushMessage
:
onPushMessage
,
offPushMessage
:
offPushMessage
,
invokePushCallback
:
invokePushCallback
...
...
packages/uni-mp-lark/dist/index.js
浏览文件 @
8791df6e
...
...
@@ -1217,6 +1217,7 @@ function getApiCallbacks (params) {
let
cid
;
let
cidErrMsg
;
let
enabled
;
function
normalizePushMessage
(
message
)
{
try
{
...
...
@@ -1228,7 +1229,9 @@ function normalizePushMessage (message) {
function
invokePushCallback
(
args
)
{
if
(
args
.
type
===
'
clientId
'
)
{
if
(
args
.
type
===
'
enabled
'
)
{
enabled
=
true
;
}
else
if
(
args
.
type
===
'
clientId
'
)
{
cid
=
args
.
cid
;
cidErrMsg
=
args
.
errMsg
;
invokeGetPushCidCallbacks
(
cid
,
args
.
errMsg
);
...
...
@@ -1258,7 +1261,7 @@ function invokeGetPushCidCallbacks (cid, errMsg) {
getPushCidCallbacks
.
length
=
0
;
}
function
getPushClient
i
d
(
args
)
{
function
getPushClient
I
d
(
args
)
{
if
(
!
isPlainObject
(
args
))
{
args
=
{};
}
...
...
@@ -1270,25 +1273,32 @@ function getPushClientid (args) {
const
hasSuccess
=
isFn
(
success
);
const
hasFail
=
isFn
(
fail
);
const
hasComplete
=
isFn
(
complete
);
getPushCidCallbacks
.
push
((
cid
,
errMsg
)
=>
{
let
res
;
if
(
cid
)
{
res
=
{
errMsg
:
'
getPushClientid:ok
'
,
cid
};
hasSuccess
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getPushClientid:fail
'
+
(
errMsg
?
'
'
+
errMsg
:
''
)
};
hasFail
&&
fail
(
res
);
Promise
.
resolve
().
then
(()
=>
{
if
(
typeof
enabled
===
'
undefined
'
)
{
enabled
=
false
;
cid
=
''
;
cidErrMsg
=
'
unipush is not enabled
'
;
}
getPushCidCallbacks
.
push
((
cid
,
errMsg
)
=>
{
let
res
;
if
(
cid
)
{
res
=
{
errMsg
:
'
getPushClientId:ok
'
,
cid
};
hasSuccess
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getPushClientId:fail
'
+
(
errMsg
?
'
'
+
errMsg
:
''
)
};
hasFail
&&
fail
(
res
);
}
hasComplete
&&
complete
(
res
);
});
if
(
typeof
cid
!==
'
undefined
'
)
{
invokeGetPushCidCallbacks
(
cid
,
cidErrMsg
);
}
hasComplete
&&
complete
(
res
);
});
if
(
typeof
cid
!==
'
undefined
'
)
{
Promise
.
resolve
().
then
(()
=>
invokeGetPushCidCallbacks
(
cid
,
cidErrMsg
));
}
}
const
onPushMessageCallbacks
=
[];
...
...
@@ -1312,7 +1322,7 @@ const offPushMessage = (fn) => {
var
api
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
getPushClient
id
:
getPushClienti
d
,
getPushClient
Id
:
getPushClientI
d
,
onPushMessage
:
onPushMessage
,
offPushMessage
:
offPushMessage
,
invokePushCallback
:
invokePushCallback
...
...
packages/uni-mp-qq/dist/index.js
浏览文件 @
8791df6e
...
...
@@ -1327,6 +1327,7 @@ function getApiCallbacks (params) {
let
cid
;
let
cidErrMsg
;
let
enabled
;
function
normalizePushMessage
(
message
)
{
try
{
...
...
@@ -1338,7 +1339,9 @@ function normalizePushMessage (message) {
function
invokePushCallback
(
args
)
{
if
(
args
.
type
===
'
clientId
'
)
{
if
(
args
.
type
===
'
enabled
'
)
{
enabled
=
true
;
}
else
if
(
args
.
type
===
'
clientId
'
)
{
cid
=
args
.
cid
;
cidErrMsg
=
args
.
errMsg
;
invokeGetPushCidCallbacks
(
cid
,
args
.
errMsg
);
...
...
@@ -1368,7 +1371,7 @@ function invokeGetPushCidCallbacks (cid, errMsg) {
getPushCidCallbacks
.
length
=
0
;
}
function
getPushClient
i
d
(
args
)
{
function
getPushClient
I
d
(
args
)
{
if
(
!
isPlainObject
(
args
))
{
args
=
{};
}
...
...
@@ -1380,25 +1383,32 @@ function getPushClientid (args) {
const
hasSuccess
=
isFn
(
success
);
const
hasFail
=
isFn
(
fail
);
const
hasComplete
=
isFn
(
complete
);
getPushCidCallbacks
.
push
((
cid
,
errMsg
)
=>
{
let
res
;
if
(
cid
)
{
res
=
{
errMsg
:
'
getPushClientid:ok
'
,
cid
};
hasSuccess
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getPushClientid:fail
'
+
(
errMsg
?
'
'
+
errMsg
:
''
)
};
hasFail
&&
fail
(
res
);
Promise
.
resolve
().
then
(()
=>
{
if
(
typeof
enabled
===
'
undefined
'
)
{
enabled
=
false
;
cid
=
''
;
cidErrMsg
=
'
unipush is not enabled
'
;
}
getPushCidCallbacks
.
push
((
cid
,
errMsg
)
=>
{
let
res
;
if
(
cid
)
{
res
=
{
errMsg
:
'
getPushClientId:ok
'
,
cid
};
hasSuccess
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getPushClientId:fail
'
+
(
errMsg
?
'
'
+
errMsg
:
''
)
};
hasFail
&&
fail
(
res
);
}
hasComplete
&&
complete
(
res
);
});
if
(
typeof
cid
!==
'
undefined
'
)
{
invokeGetPushCidCallbacks
(
cid
,
cidErrMsg
);
}
hasComplete
&&
complete
(
res
);
});
if
(
typeof
cid
!==
'
undefined
'
)
{
Promise
.
resolve
().
then
(()
=>
invokeGetPushCidCallbacks
(
cid
,
cidErrMsg
));
}
}
const
onPushMessageCallbacks
=
[];
...
...
@@ -1423,7 +1433,7 @@ const offPushMessage = (fn) => {
var
api
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
createMediaQueryObserver
:
createMediaQueryObserver
,
getPushClient
id
:
getPushClienti
d
,
getPushClient
Id
:
getPushClientI
d
,
onPushMessage
:
onPushMessage
,
offPushMessage
:
offPushMessage
,
invokePushCallback
:
invokePushCallback
...
...
packages/uni-mp-toutiao/dist/index.js
浏览文件 @
8791df6e
...
...
@@ -1419,6 +1419,7 @@ function getApiCallbacks (params) {
let
cid
;
let
cidErrMsg
;
let
enabled
;
function
normalizePushMessage
(
message
)
{
try
{
...
...
@@ -1430,7 +1431,9 @@ function normalizePushMessage (message) {
function
invokePushCallback
(
args
)
{
if
(
args
.
type
===
'
clientId
'
)
{
if
(
args
.
type
===
'
enabled
'
)
{
enabled
=
true
;
}
else
if
(
args
.
type
===
'
clientId
'
)
{
cid
=
args
.
cid
;
cidErrMsg
=
args
.
errMsg
;
invokeGetPushCidCallbacks
(
cid
,
args
.
errMsg
);
...
...
@@ -1460,7 +1463,7 @@ function invokeGetPushCidCallbacks (cid, errMsg) {
getPushCidCallbacks
.
length
=
0
;
}
function
getPushClient
i
d
(
args
)
{
function
getPushClient
I
d
(
args
)
{
if
(
!
isPlainObject
(
args
))
{
args
=
{};
}
...
...
@@ -1472,25 +1475,32 @@ function getPushClientid (args) {
const
hasSuccess
=
isFn
(
success
);
const
hasFail
=
isFn
(
fail
);
const
hasComplete
=
isFn
(
complete
);
getPushCidCallbacks
.
push
((
cid
,
errMsg
)
=>
{
let
res
;
if
(
cid
)
{
res
=
{
errMsg
:
'
getPushClientid:ok
'
,
cid
};
hasSuccess
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getPushClientid:fail
'
+
(
errMsg
?
'
'
+
errMsg
:
''
)
};
hasFail
&&
fail
(
res
);
Promise
.
resolve
().
then
(()
=>
{
if
(
typeof
enabled
===
'
undefined
'
)
{
enabled
=
false
;
cid
=
''
;
cidErrMsg
=
'
unipush is not enabled
'
;
}
getPushCidCallbacks
.
push
((
cid
,
errMsg
)
=>
{
let
res
;
if
(
cid
)
{
res
=
{
errMsg
:
'
getPushClientId:ok
'
,
cid
};
hasSuccess
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getPushClientId:fail
'
+
(
errMsg
?
'
'
+
errMsg
:
''
)
};
hasFail
&&
fail
(
res
);
}
hasComplete
&&
complete
(
res
);
});
if
(
typeof
cid
!==
'
undefined
'
)
{
invokeGetPushCidCallbacks
(
cid
,
cidErrMsg
);
}
hasComplete
&&
complete
(
res
);
});
if
(
typeof
cid
!==
'
undefined
'
)
{
Promise
.
resolve
().
then
(()
=>
invokeGetPushCidCallbacks
(
cid
,
cidErrMsg
));
}
}
const
onPushMessageCallbacks
=
[];
...
...
@@ -1515,7 +1525,7 @@ const offPushMessage = (fn) => {
var
api
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
createMediaQueryObserver
:
createMediaQueryObserver
,
getPushClient
id
:
getPushClienti
d
,
getPushClient
Id
:
getPushClientI
d
,
onPushMessage
:
onPushMessage
,
offPushMessage
:
offPushMessage
,
invokePushCallback
:
invokePushCallback
...
...
packages/uni-mp-weixin/dist/index.js
浏览文件 @
8791df6e
...
...
@@ -1136,6 +1136,7 @@ function getApiCallbacks (params) {
let
cid
;
let
cidErrMsg
;
let
enabled
;
function
normalizePushMessage
(
message
)
{
try
{
...
...
@@ -1147,7 +1148,9 @@ function normalizePushMessage (message) {
function
invokePushCallback
(
args
)
{
if
(
args
.
type
===
'
clientId
'
)
{
if
(
args
.
type
===
'
enabled
'
)
{
enabled
=
true
;
}
else
if
(
args
.
type
===
'
clientId
'
)
{
cid
=
args
.
cid
;
cidErrMsg
=
args
.
errMsg
;
invokeGetPushCidCallbacks
(
cid
,
args
.
errMsg
);
...
...
@@ -1177,7 +1180,7 @@ function invokeGetPushCidCallbacks (cid, errMsg) {
getPushCidCallbacks
.
length
=
0
;
}
function
getPushClient
i
d
(
args
)
{
function
getPushClient
I
d
(
args
)
{
if
(
!
isPlainObject
(
args
))
{
args
=
{};
}
...
...
@@ -1189,25 +1192,32 @@ function getPushClientid (args) {
const
hasSuccess
=
isFn
(
success
);
const
hasFail
=
isFn
(
fail
);
const
hasComplete
=
isFn
(
complete
);
getPushCidCallbacks
.
push
((
cid
,
errMsg
)
=>
{
let
res
;
if
(
cid
)
{
res
=
{
errMsg
:
'
getPushClientid:ok
'
,
cid
};
hasSuccess
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getPushClientid:fail
'
+
(
errMsg
?
'
'
+
errMsg
:
''
)
};
hasFail
&&
fail
(
res
);
Promise
.
resolve
().
then
(()
=>
{
if
(
typeof
enabled
===
'
undefined
'
)
{
enabled
=
false
;
cid
=
''
;
cidErrMsg
=
'
unipush is not enabled
'
;
}
getPushCidCallbacks
.
push
((
cid
,
errMsg
)
=>
{
let
res
;
if
(
cid
)
{
res
=
{
errMsg
:
'
getPushClientId:ok
'
,
cid
};
hasSuccess
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getPushClientId:fail
'
+
(
errMsg
?
'
'
+
errMsg
:
''
)
};
hasFail
&&
fail
(
res
);
}
hasComplete
&&
complete
(
res
);
});
if
(
typeof
cid
!==
'
undefined
'
)
{
invokeGetPushCidCallbacks
(
cid
,
cidErrMsg
);
}
hasComplete
&&
complete
(
res
);
});
if
(
typeof
cid
!==
'
undefined
'
)
{
Promise
.
resolve
().
then
(()
=>
invokeGetPushCidCallbacks
(
cid
,
cidErrMsg
));
}
}
const
onPushMessageCallbacks
=
[];
...
...
@@ -1231,7 +1241,7 @@ const offPushMessage = (fn) => {
var
api
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
getPushClient
id
:
getPushClienti
d
,
getPushClient
Id
:
getPushClientI
d
,
onPushMessage
:
onPushMessage
,
offPushMessage
:
offPushMessage
,
invokePushCallback
:
invokePushCallback
...
...
packages/uni-mp-xhs/dist/index.js
浏览文件 @
8791df6e
...
...
@@ -997,6 +997,7 @@ function getApiCallbacks (params) {
let
cid
;
let
cidErrMsg
;
let
enabled
;
function
normalizePushMessage
(
message
)
{
try
{
...
...
@@ -1008,7 +1009,9 @@ function normalizePushMessage (message) {
function
invokePushCallback
(
args
)
{
if
(
args
.
type
===
'
clientId
'
)
{
if
(
args
.
type
===
'
enabled
'
)
{
enabled
=
true
;
}
else
if
(
args
.
type
===
'
clientId
'
)
{
cid
=
args
.
cid
;
cidErrMsg
=
args
.
errMsg
;
invokeGetPushCidCallbacks
(
cid
,
args
.
errMsg
);
...
...
@@ -1038,7 +1041,7 @@ function invokeGetPushCidCallbacks (cid, errMsg) {
getPushCidCallbacks
.
length
=
0
;
}
function
getPushClient
i
d
(
args
)
{
function
getPushClient
I
d
(
args
)
{
if
(
!
isPlainObject
(
args
))
{
args
=
{};
}
...
...
@@ -1050,25 +1053,32 @@ function getPushClientid (args) {
const
hasSuccess
=
isFn
(
success
);
const
hasFail
=
isFn
(
fail
);
const
hasComplete
=
isFn
(
complete
);
getPushCidCallbacks
.
push
((
cid
,
errMsg
)
=>
{
let
res
;
if
(
cid
)
{
res
=
{
errMsg
:
'
getPushClientid:ok
'
,
cid
};
hasSuccess
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getPushClientid:fail
'
+
(
errMsg
?
'
'
+
errMsg
:
''
)
};
hasFail
&&
fail
(
res
);
Promise
.
resolve
().
then
(()
=>
{
if
(
typeof
enabled
===
'
undefined
'
)
{
enabled
=
false
;
cid
=
''
;
cidErrMsg
=
'
unipush is not enabled
'
;
}
getPushCidCallbacks
.
push
((
cid
,
errMsg
)
=>
{
let
res
;
if
(
cid
)
{
res
=
{
errMsg
:
'
getPushClientId:ok
'
,
cid
};
hasSuccess
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getPushClientId:fail
'
+
(
errMsg
?
'
'
+
errMsg
:
''
)
};
hasFail
&&
fail
(
res
);
}
hasComplete
&&
complete
(
res
);
});
if
(
typeof
cid
!==
'
undefined
'
)
{
invokeGetPushCidCallbacks
(
cid
,
cidErrMsg
);
}
hasComplete
&&
complete
(
res
);
});
if
(
typeof
cid
!==
'
undefined
'
)
{
Promise
.
resolve
().
then
(()
=>
invokeGetPushCidCallbacks
(
cid
,
cidErrMsg
));
}
}
const
onPushMessageCallbacks
=
[];
...
...
@@ -1092,7 +1102,7 @@ const offPushMessage = (fn) => {
var
api
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
getPushClient
id
:
getPushClienti
d
,
getPushClient
Id
:
getPushClientI
d
,
onPushMessage
:
onPushMessage
,
offPushMessage
:
offPushMessage
,
invokePushCallback
:
invokePushCallback
...
...
packages/uni-quickapp-native/dist/vue.dev.js
浏览文件 @
8791df6e
此差异已折叠。
点击以展开。
packages/uni-quickapp-native/dist/vue.prod.js
浏览文件 @
8791df6e
此差异已折叠。
点击以展开。
packages/uni-quickapp-webview/dist/index.js
浏览文件 @
8791df6e
...
...
@@ -1168,6 +1168,7 @@ function getApiCallbacks (params) {
let
cid
;
let
cidErrMsg
;
let
enabled
;
function
normalizePushMessage
(
message
)
{
try
{
...
...
@@ -1179,7 +1180,9 @@ function normalizePushMessage (message) {
function
invokePushCallback
(
args
)
{
if
(
args
.
type
===
'
clientId
'
)
{
if
(
args
.
type
===
'
enabled
'
)
{
enabled
=
true
;
}
else
if
(
args
.
type
===
'
clientId
'
)
{
cid
=
args
.
cid
;
cidErrMsg
=
args
.
errMsg
;
invokeGetPushCidCallbacks
(
cid
,
args
.
errMsg
);
...
...
@@ -1209,7 +1212,7 @@ function invokeGetPushCidCallbacks (cid, errMsg) {
getPushCidCallbacks
.
length
=
0
;
}
function
getPushClient
i
d
(
args
)
{
function
getPushClient
I
d
(
args
)
{
if
(
!
isPlainObject
(
args
))
{
args
=
{};
}
...
...
@@ -1221,25 +1224,32 @@ function getPushClientid (args) {
const
hasSuccess
=
isFn
(
success
);
const
hasFail
=
isFn
(
fail
);
const
hasComplete
=
isFn
(
complete
);
getPushCidCallbacks
.
push
((
cid
,
errMsg
)
=>
{
let
res
;
if
(
cid
)
{
res
=
{
errMsg
:
'
getPushClientid:ok
'
,
cid
};
hasSuccess
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getPushClientid:fail
'
+
(
errMsg
?
'
'
+
errMsg
:
''
)
};
hasFail
&&
fail
(
res
);
Promise
.
resolve
().
then
(()
=>
{
if
(
typeof
enabled
===
'
undefined
'
)
{
enabled
=
false
;
cid
=
''
;
cidErrMsg
=
'
unipush is not enabled
'
;
}
getPushCidCallbacks
.
push
((
cid
,
errMsg
)
=>
{
let
res
;
if
(
cid
)
{
res
=
{
errMsg
:
'
getPushClientId:ok
'
,
cid
};
hasSuccess
&&
success
(
res
);
}
else
{
res
=
{
errMsg
:
'
getPushClientId:fail
'
+
(
errMsg
?
'
'
+
errMsg
:
''
)
};
hasFail
&&
fail
(
res
);
}
hasComplete
&&
complete
(
res
);
});
if
(
typeof
cid
!==
'
undefined
'
)
{
invokeGetPushCidCallbacks
(
cid
,
cidErrMsg
);
}
hasComplete
&&
complete
(
res
);
});
if
(
typeof
cid
!==
'
undefined
'
)
{
Promise
.
resolve
().
then
(()
=>
invokeGetPushCidCallbacks
(
cid
,
cidErrMsg
));
}
}
const
onPushMessageCallbacks
=
[];
...
...
@@ -1263,7 +1273,7 @@ const offPushMessage = (fn) => {
var
api
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
getPushClient
id
:
getPushClienti
d
,
getPushClient
Id
:
getPushClientI
d
,
onPushMessage
:
onPushMessage
,
offPushMessage
:
offPushMessage
,
invokePushCallback
:
invokePushCallback
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录