syttunnel 0.1.2-0 → 0.1.5-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -20,6 +20,7 @@ export declare class SFAppCommon extends AppCommon {
|
|
|
20
20
|
getIMEICode(): Promise<string>;
|
|
21
21
|
getPushAuthStatus(): Promise<boolean>;
|
|
22
22
|
setPushState(): Promise<ICodeAndMessageResponse>;
|
|
23
|
+
setPushStateNoTimeLimit(): Promise<ICodeAndMessageResponse>;
|
|
23
24
|
getLocalSource(params: IGetLocalSourceParams): Promise<IGetLocalSourceResponse>;
|
|
24
25
|
getReducerData(params: IGetReducerDataParams): Promise<any>;
|
|
25
26
|
getDeviceId(): Promise<string>;
|
|
@@ -3,7 +3,7 @@ import { CommonEvents } from "../basic/eventsName";
|
|
|
3
3
|
/**
|
|
4
4
|
* 顺丰内部使用的事件
|
|
5
5
|
*/
|
|
6
|
-
export declare type SFEvents = CommonEvents | "getUserAvatar" | "getUserBaseInfo" | "payBySVIP" | "payBySDK" | "wxAutoPaySignReq" | "payWaybillByPayId" | "digiCnyPayResult" | "startGetIMEICode" | "getReducerData" | "getDeviceId" | "syncCookie" | "getPushAuthStatus" | "setStateToPush" | "getLocalWebSource" | "navigate" | "setCanBack";
|
|
6
|
+
export declare type SFEvents = CommonEvents | "getUserAvatar" | "getUserBaseInfo" | "payBySVIP" | "payBySDK" | "wxAutoPaySignReq" | "payWaybillByPayId" | "digiCnyPayResult" | "startGetIMEICode" | "getReducerData" | "getDeviceId" | "syncCookie" | "getPushAuthStatus" | "setStateToPush" | "setStateToPushNoTimeLimit" | "getLocalWebSource" | "navigate" | "setCanBack";
|
|
7
7
|
export interface IPostSFParams extends IPostParams {
|
|
8
8
|
method: SFEvents;
|
|
9
9
|
}
|
package/package.json
CHANGED
package/syttunnel.js
CHANGED
|
@@ -426,7 +426,9 @@ var Bridge = /** @class */ (function () {
|
|
|
426
426
|
this.onMessage = this.onMessage.bind(this);
|
|
427
427
|
}
|
|
428
428
|
Bridge.prototype.onMessage = function (msg) {
|
|
429
|
-
var message = typeof msg.data === "string"
|
|
429
|
+
var message = typeof msg.data === "string"
|
|
430
|
+
? JSON.parse(msg.data || "")
|
|
431
|
+
: msg.data || {};
|
|
430
432
|
var method = message.method;
|
|
431
433
|
var value = message.value;
|
|
432
434
|
var uniqueId = message.uniqueId;
|
|
@@ -461,7 +463,7 @@ var Bridge = /** @class */ (function () {
|
|
|
461
463
|
Bridge.prototype.postMessage = function (params) {
|
|
462
464
|
return new Promise(function (resolve, reject) {
|
|
463
465
|
bridge.dealPostMessage(params, function (result) {
|
|
464
|
-
if (result) {
|
|
466
|
+
if (result !== null && result !== undefined) {
|
|
465
467
|
resolve(result);
|
|
466
468
|
}
|
|
467
469
|
else {
|