pb-sxp-ui 1.15.20-alpha.1 → 1.15.20-alpha.3
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 +6 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -20
- 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 +6 -20
- 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 +5 -0
- package/es/core/utils/cryptojs.d.ts +3 -0
- package/es/core/utils/cryptojs.js +18 -0
- package/lib/core/context/SxpDataSourceProvider.js +5 -0
- package/lib/core/utils/cryptojs.d.ts +3 -0
- package/lib/core/utils/cryptojs.js +23 -0
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
@@ -44,7 +44,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
44
44
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
45
45
|
PERFORMANCE OF THIS SOFTWARE.
|
46
46
|
***************************************************************************** */
|
47
|
-
/* global Reflect, Promise, SuppressedError, Symbol
|
47
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
48
48
|
|
49
49
|
|
50
50
|
function __rest(s, e) {
|
@@ -745,25 +745,11 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
745
745
|
}
|
746
746
|
// 事件上报优化
|
747
747
|
// Beacon API 用于发送异步和非阻塞请求到服务器。这类请求不需要响应。
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
// JSON.stringify({
|
754
|
-
// body: btoa(
|
755
|
-
// encodeURIComponent(
|
756
|
-
// JSON.stringify({ ...options.body, ...bffDataSource.headers, 'x-user-id': fakeUserId })
|
757
|
-
// )
|
758
|
-
// )
|
759
|
-
// })
|
760
|
-
// ],
|
761
|
-
// {
|
762
|
-
// type: 'application/json;charset=UTF-8'
|
763
|
-
// }
|
764
|
-
// )
|
765
|
-
// );
|
766
|
-
// }
|
748
|
+
if (options.type === 'beacon' && navigator.sendBeacon) {
|
749
|
+
const formData = new FormData();
|
750
|
+
formData.append('data', JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId })));
|
751
|
+
return navigator.sendBeacon(`${url}/api/${path}`, formData);
|
752
|
+
}
|
767
753
|
return window
|
768
754
|
.fetch(`${url}/api/${path}`, {
|
769
755
|
headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId }, bffDataSource.headers),
|