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>;
@@ -1,8 +1,4 @@
1
1
  import { AppUser } from "../basic/appUser";
2
- export interface IGetUserInfoParams {
3
- needLogin?: boolean;
4
- domain?: string;
5
- }
6
2
  export interface IGetUserBaseInfoParams {
7
3
  needLogin?: boolean;
8
4
  }
@@ -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
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "syttunnel",
3
- "version": "0.1.2-0",
3
+ "version": "0.1.5-1",
4
4
  "description": "",
5
- "main": "syttunel.js",
5
+ "main": "syttunnel.js",
6
6
  "types": "index.d.ts",
7
7
  "scripts": {
8
8
  "test": "echo \"Error: no test specified\" && exit 1"
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" ? JSON.parse(msg.data) : msg.data;
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 {