pb-sxp-ui 1.15.18 → 1.15.20-alpha.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.
- package/dist/index.cjs +27 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +27 -12
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +4 -4
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +27 -12
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +4 -4
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/context/SxpDataSourceProvider.js +8 -12
- package/lib/core/context/SxpDataSourceProvider.js +8 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -723,15 +723,25 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
723
723
|
}
|
724
724
|
// 事件上报优化
|
725
725
|
// Beacon API 用于发送异步和非阻塞请求到服务器。这类请求不需要响应。
|
726
|
-
if (options.type === 'beacon' && navigator.sendBeacon) {
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
}
|
726
|
+
// if (options.type === 'beacon' && navigator.sendBeacon) {
|
727
|
+
// return navigator.sendBeacon(
|
728
|
+
// `${url}/api/${path}`,
|
729
|
+
// new Blob(
|
730
|
+
// [
|
731
|
+
// JSON.stringify({
|
732
|
+
// body: btoa(
|
733
|
+
// encodeURIComponent(
|
734
|
+
// JSON.stringify({ ...options.body, ...bffDataSource.headers, 'x-user-id': fakeUserId })
|
735
|
+
// )
|
736
|
+
// )
|
737
|
+
// })
|
738
|
+
// ],
|
739
|
+
// {
|
740
|
+
// type: 'application/json;charset=UTF-8'
|
741
|
+
// }
|
742
|
+
// )
|
743
|
+
// );
|
744
|
+
// }
|
735
745
|
return window
|
736
746
|
.fetch(`${url}/api/${path}`, {
|
737
747
|
headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId }, bffDataSource.headers),
|
@@ -984,13 +994,18 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
984
994
|
return uri + separator + key + '=' + value;
|
985
995
|
}
|
986
996
|
}
|
987
|
-
if (eventName === 'PageView') {
|
997
|
+
if (eventName === 'PageView' && (pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name) === 'PageView') {
|
988
998
|
const currentUrl = window.location.href;
|
989
999
|
const newUrl = updateQueryStringParameter(currentUrl, 'timestamp', Date.now());
|
990
1000
|
history.pushState({ path: newUrl }, '', newUrl);
|
991
1001
|
}
|
992
|
-
|
993
|
-
|
1002
|
+
else {
|
1003
|
+
const body = getEventParamsByJson(pixelEventParamsJson);
|
1004
|
+
window === null || window === void 0 ? void 0 : window.fbq('track', pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name, body);
|
1005
|
+
if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.gtag) === 'function') {
|
1006
|
+
window === null || window === void 0 ? void 0 : window.gtag('event', 'page_view');
|
1007
|
+
}
|
1008
|
+
}
|
994
1009
|
}
|
995
1010
|
else if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.gtag) === 'function') {
|
996
1011
|
window === null || window === void 0 ? void 0 : window.gtag('event', 'page_view');
|