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/index.cjs +13 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -23
- 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 +17 -26
- 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 +13 -4
- package/lib/core/context/SxpDataSourceProvider.js +13 -4
- package/package.json +1 -2
- package/es/core/utils/cryptojs.d.ts +0 -3
- package/es/core/utils/cryptojs.js +0 -18
- package/lib/core/utils/cryptojs.d.ts +0 -3
- package/lib/core/utils/cryptojs.js +0 -23
package/dist/index.cjs
CHANGED
@@ -8,7 +8,6 @@ var pako = require('pako');
|
|
8
8
|
var React = require('react');
|
9
9
|
var qs = require('qs');
|
10
10
|
var EventEmitter = require('eventemitter3');
|
11
|
-
var CryptoJS = require('crypto-js');
|
12
11
|
var css = require('@emotion/css');
|
13
12
|
var ReactDOM = require('react-dom');
|
14
13
|
|
@@ -633,25 +632,6 @@ const Consent$3 = ({ width = window.innerWidth, height = window.innerHeight, pri
|
|
633
632
|
};
|
634
633
|
var Consent$4 = React.memo(Consent$3);
|
635
634
|
|
636
|
-
/*
|
637
|
-
* @Author: binruan@chatlabs.com
|
638
|
-
* @Date: 2025-03-24 17:20:35
|
639
|
-
* @LastEditors: binruan@chatlabs.com
|
640
|
-
* @LastEditTime: 2025-03-24 17:42:04
|
641
|
-
* @FilePath: \pb-sxp-ui\src\core\utils\cryptojs.ts
|
642
|
-
*
|
643
|
-
*/
|
644
|
-
// 使用CryptoJS实现
|
645
|
-
function encrypt(text, key) {
|
646
|
-
const encrypted = CryptoJS.AES.encrypt(text, CryptoJS.enc.Utf8.parse(key), // 密钥
|
647
|
-
{
|
648
|
-
iv: CryptoJS.enc.Utf8.parse(key), // IV是密钥的字节
|
649
|
-
mode: CryptoJS.mode.CBC,
|
650
|
-
padding: CryptoJS.pad.Pkcs7
|
651
|
-
});
|
652
|
-
return encrypted.ciphertext.toString(CryptoJS.enc.Base64);
|
653
|
-
}
|
654
|
-
|
655
635
|
const SxpDataSourceContext = React.createContext({
|
656
636
|
rtcList: [],
|
657
637
|
tagList: []
|
@@ -767,7 +747,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
767
747
|
// Beacon API 用于发送异步和非阻塞请求到服务器。这类请求不需要响应。
|
768
748
|
if (options.type === 'beacon' && navigator.sendBeacon) {
|
769
749
|
return navigator.sendBeacon(`${url}/api/${path}`, new Blob([
|
770
|
-
|
750
|
+
JSON.stringify({
|
751
|
+
body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
|
752
|
+
})
|
771
753
|
], {
|
772
754
|
type: 'application/json;charset=UTF-8'
|
773
755
|
}));
|
@@ -947,7 +929,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
947
929
|
bffDataSource
|
948
930
|
]);
|
949
931
|
const bffFbReport = React.useCallback(({ eventName, product }) => {
|
950
|
-
var _a, _b, _c, _d, _e, _f;
|
932
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
951
933
|
if (!enableReportEvent ||
|
952
934
|
!enabledMetaConversionApi ||
|
953
935
|
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) ||
|
@@ -1011,7 +993,15 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1011
993
|
}
|
1012
994
|
};
|
1013
995
|
getEventParams(jsonParams);
|
1014
|
-
|
996
|
+
const params = {};
|
997
|
+
const queryString = location.search.slice(1);
|
998
|
+
(_f = splitUrlParams(queryString)) === null || _f === void 0 ? void 0 : _f.map((val) => {
|
999
|
+
const key = val.split('=')[0];
|
1000
|
+
const value = val.split('=')[1];
|
1001
|
+
params[key] = value;
|
1002
|
+
});
|
1003
|
+
const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
|
1004
|
+
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)}` : ''}`, {
|
1015
1005
|
method: 'POST',
|
1016
1006
|
body: jsonParams,
|
1017
1007
|
type: 'beacon'
|