pb-sxp-ui 1.15.12-alpha.5 → 1.15.12-alpha.6
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 +21 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -3
- 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 +24 -7
- 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 +2 -3
- package/es/core/utils/cryptojs.d.ts +3 -0
- package/es/core/utils/cryptojs.js +18 -0
- package/lib/core/context/SxpDataSourceProvider.js +2 -3
- package/lib/core/utils/cryptojs.d.ts +3 -0
- package/lib/core/utils/cryptojs.js +23 -0
- package/package.json +2 -1
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('@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';
|
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';
|
6
6
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
8
8
|
var n = Object.create(null);
|
@@ -625,6 +625,25 @@
|
|
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
|
+
|
628
647
|
const SxpDataSourceContext = React.createContext({
|
629
648
|
rtcList: [],
|
630
649
|
tagList: []
|
@@ -740,9 +759,7 @@
|
|
740
759
|
// Beacon API 用于发送异步和非阻塞请求到服务器。这类请求不需要响应。
|
741
760
|
if (options.type === 'beacon' && navigator.sendBeacon) {
|
742
761
|
return navigator.sendBeacon(`${url}/api/${path}`, new Blob([
|
743
|
-
JSON.stringify({
|
744
|
-
body: encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId })))
|
745
|
-
})
|
762
|
+
encrypt(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId })), 'dcAR82I0b8sgwCku')
|
746
763
|
], {
|
747
764
|
type: 'application/json;charset=UTF-8'
|
748
765
|
}));
|