pb-sxp-ui 1.15.12-alpha.6 → 1.15.12-alpha.8

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/pb-ui.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash'), require('uuid'), require('pako'), require('react'), require('qs'), require('eventemitter3'), require('crypto-js'), require('@emotion/css'), require('react-dom')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'lodash', 'uuid', 'pako', 'react', 'qs', 'eventemitter3', 'crypto-js', '@emotion/css', 'react-dom'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PUI = {}, global.lodash, global.uuid$1, global.pako, global.React, global.qs, global.EventEmitter, global.CryptoJS, global.css, global.ReactDOM));
5
- })(this, (function (exports, lodash, uuid$1, pako, React, qs, EventEmitter, CryptoJS, css, ReactDOM) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash'), require('uuid'), require('pako'), require('react'), require('qs'), require('eventemitter3'), require('@emotion/css'), require('react-dom')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'lodash', 'uuid', 'pako', 'react', 'qs', 'eventemitter3', '@emotion/css', 'react-dom'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PUI = {}, global.lodash, global.uuid$1, global.pako, global.React, global.qs, global.EventEmitter, global.css, global.ReactDOM));
5
+ })(this, (function (exports, lodash, uuid$1, pako, React, qs, EventEmitter, css, ReactDOM) { 'use strict';
6
6
 
7
7
  function _interopNamespaceDefault(e) {
8
8
  var n = Object.create(null);
@@ -625,25 +625,6 @@
625
625
  };
626
626
  var Consent$4 = React.memo(Consent$3);
627
627
 
628
- /*
629
- * @Author: binruan@chatlabs.com
630
- * @Date: 2025-03-24 17:20:35
631
- * @LastEditors: binruan@chatlabs.com
632
- * @LastEditTime: 2025-03-24 17:42:04
633
- * @FilePath: \pb-sxp-ui\src\core\utils\cryptojs.ts
634
- *
635
- */
636
- // 使用CryptoJS实现
637
- function encrypt(text, key) {
638
- const encrypted = CryptoJS.AES.encrypt(text, CryptoJS.enc.Utf8.parse(key), // 密钥
639
- {
640
- iv: CryptoJS.enc.Utf8.parse(key), // IV是密钥的字节
641
- mode: CryptoJS.mode.CBC,
642
- padding: CryptoJS.pad.Pkcs7
643
- });
644
- return encrypted.ciphertext.toString(CryptoJS.enc.Base64);
645
- }
646
-
647
628
  const SxpDataSourceContext = React.createContext({
648
629
  rtcList: [],
649
630
  tagList: []
@@ -759,7 +740,9 @@
759
740
  // Beacon API 用于发送异步和非阻塞请求到服务器。这类请求不需要响应。
760
741
  if (options.type === 'beacon' && navigator.sendBeacon) {
761
742
  return navigator.sendBeacon(`${url}/api/${path}`, new Blob([
762
- encrypt(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId })), 'dcAR82I0b8sgwCku')
743
+ JSON.stringify({
744
+ body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
745
+ })
763
746
  ], {
764
747
  type: 'application/json;charset=UTF-8'
765
748
  }));
@@ -939,7 +922,7 @@
939
922
  bffDataSource
940
923
  ]);
941
924
  const bffFbReport = React.useCallback(({ eventName, product }) => {
942
- var _a, _b, _c, _d, _e, _f;
925
+ var _a, _b, _c, _d, _e, _f, _g;
943
926
  if (!enableReportEvent ||
944
927
  !enabledMetaConversionApi ||
945
928
  (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) ||
@@ -1003,7 +986,15 @@
1003
986
  }
1004
987
  };
1005
988
  getEventParams(jsonParams);
1006
- return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/event/report/FB/${(_f = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _f === void 0 ? void 0 : _f['x-app-id']}/${eventName}`, {
989
+ const params = {};
990
+ const queryString = location.search.slice(1);
991
+ (_f = splitUrlParams(queryString)) === null || _f === void 0 ? void 0 : _f.map((val) => {
992
+ const key = val.split('=')[0];
993
+ const value = val.split('=')[1];
994
+ params[key] = value;
995
+ });
996
+ const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
997
+ return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_g = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _g === void 0 ? void 0 : _g['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
1007
998
  method: 'POST',
1008
999
  body: jsonParams,
1009
1000
  type: 'beacon'