pb-sxp-ui 1.15.12-alpha.7 → 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
@@ -739,22 +739,7 @@
739
739
  // 事件上报优化
740
740
  // Beacon API 用于发送异步和非阻塞请求到服务器。这类请求不需要响应。
741
741
  if (options.type === 'beacon' && navigator.sendBeacon) {
742
- return navigator.sendBeacon(`${url}/api/${path}`, new Blob(
743
- // [
744
- // JSON.stringify({
745
- // body: encrypt(
746
- // JSON.stringify(
747
- // btoa(
748
- // encodeURIComponent(
749
- // JSON.stringify({ ...options.body, ...bffDataSource.headers, 'x-user-id': fakeUserId })
750
- // )
751
- // )
752
- // ),
753
- // 'dcAR82I0b8sgwCku'
754
- // )
755
- // })
756
- // ],
757
- [
742
+ return navigator.sendBeacon(`${url}/api/${path}`, new Blob([
758
743
  JSON.stringify({
759
744
  body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
760
745
  })
@@ -937,7 +922,7 @@
937
922
  bffDataSource
938
923
  ]);
939
924
  const bffFbReport = React.useCallback(({ eventName, product }) => {
940
- var _a, _b, _c, _d, _e, _f;
925
+ var _a, _b, _c, _d, _e, _f, _g;
941
926
  if (!enableReportEvent ||
942
927
  !enabledMetaConversionApi ||
943
928
  (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) ||
@@ -1001,7 +986,15 @@
1001
986
  }
1002
987
  };
1003
988
  getEventParams(jsonParams);
1004
- 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)}` : ''}`, {
1005
998
  method: 'POST',
1006
999
  body: jsonParams,
1007
1000
  type: 'beacon'