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/index.js CHANGED
@@ -724,22 +724,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
724
724
  // 事件上报优化
725
725
  // Beacon API 用于发送异步和非阻塞请求到服务器。这类请求不需要响应。
726
726
  if (options.type === 'beacon' && navigator.sendBeacon) {
727
- return navigator.sendBeacon(`${url}/api/${path}`, new Blob(
728
- // [
729
- // JSON.stringify({
730
- // body: encrypt(
731
- // JSON.stringify(
732
- // btoa(
733
- // encodeURIComponent(
734
- // JSON.stringify({ ...options.body, ...bffDataSource.headers, 'x-user-id': fakeUserId })
735
- // )
736
- // )
737
- // ),
738
- // 'dcAR82I0b8sgwCku'
739
- // )
740
- // })
741
- // ],
742
- [
727
+ return navigator.sendBeacon(`${url}/api/${path}`, new Blob([
743
728
  JSON.stringify({
744
729
  body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
745
730
  })
@@ -922,7 +907,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
922
907
  bffDataSource
923
908
  ]);
924
909
  const bffFbReport = useCallback(({ eventName, product }) => {
925
- var _a, _b, _c, _d, _e, _f;
910
+ var _a, _b, _c, _d, _e, _f, _g;
926
911
  if (!enableReportEvent ||
927
912
  !enabledMetaConversionApi ||
928
913
  (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) ||
@@ -986,7 +971,15 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
986
971
  }
987
972
  };
988
973
  getEventParams(jsonParams);
989
- 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}`, {
974
+ const params = {};
975
+ const queryString = location.search.slice(1);
976
+ (_f = splitUrlParams(queryString)) === null || _f === void 0 ? void 0 : _f.map((val) => {
977
+ const key = val.split('=')[0];
978
+ const value = val.split('=')[1];
979
+ params[key] = value;
980
+ });
981
+ const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
982
+ 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)}` : ''}`, {
990
983
  method: 'POST',
991
984
  body: jsonParams,
992
985
  type: 'beacon'