@cpzxrobot/sdk 1.2.90 → 1.2.91

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.
package/dist/index.js CHANGED
@@ -412,6 +412,7 @@ class Cpzxrobot {
412
412
  return platform.callHandler("axios_upload", url, option);
413
413
  },
414
414
  getAsSse: async function (url, fn, config) {
415
+ console.log("getAsSse", url, fn);
415
416
  var randomId = Math.random().toString(36).substring(2);
416
417
  that.sseCallbacks[randomId] = fn;
417
418
  await platform.callHandler("axios_getAsSse", url, config, randomId);
@@ -439,6 +440,7 @@ class Cpzxrobot {
439
440
  }
440
441
  window.addEventListener('message', (event) => {
441
442
  if (event.data == 'capturePort') {
443
+ console.log("capturePort", event);
442
444
  if (event.ports[0] != null) {
443
445
  this.messagePort = event.ports[0];
444
446
  this.messagePort.onmessage = (event) => {
@@ -449,6 +451,9 @@ class Cpzxrobot {
449
451
  };
450
452
  }
451
453
  }
454
+ else {
455
+ console.log("message", event);
456
+ }
452
457
  }, false);
453
458
  }
454
459
  else {
package/index.ts CHANGED
@@ -446,11 +446,12 @@ export class Cpzxrobot {
446
446
  config.preview = true;
447
447
  }
448
448
  return platform.callHandler("axios_getAndSave", url, config);
449
- },
449
+ },
450
450
  upload: function (url, option) {
451
451
  return platform.callHandler("axios_upload", url, option);
452
452
  },
453
453
  getAsSse: async function (url, fn, config?) {
454
+ console.log("getAsSse", url, fn);
454
455
  var randomId = Math.random().toString(36).substring(2);
455
456
  that.sseCallbacks[randomId] = fn;
456
457
  await platform.callHandler("axios_getAsSse", url, config, randomId);
@@ -464,7 +465,7 @@ export class Cpzxrobot {
464
465
  window.flutter_inappwebview.callHandler != null
465
466
  ) {
466
467
  this.platformReady = Promise.resolve(true);
467
- } else {
468
+ } else {
468
469
  this.platformReady = new Promise<boolean>((resolve, reject) => {
469
470
  window.addEventListener(
470
471
  "flutterInAppWebViewPlatformReady",
@@ -481,6 +482,7 @@ export class Cpzxrobot {
481
482
  }
482
483
  window.addEventListener('message', (event) => {
483
484
  if (event.data == 'capturePort') {
485
+ console.log("capturePort", event);
484
486
  if (event.ports[0] != null) {
485
487
  this.messagePort = event.ports[0];
486
488
  this.messagePort.onmessage = (event) => {
@@ -490,7 +492,10 @@ export class Cpzxrobot {
490
492
  }
491
493
  };
492
494
  }
495
+ }else{
496
+ console.log("message", event);
493
497
  }
498
+
494
499
  }, false);
495
500
  } else {
496
501
  if (this.isLocalDomain(domain)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.2.90",
3
+ "version": "1.2.91",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {