From 957d4b44b4d6a93e05bd4537d8b1935ccd2a4c03 Mon Sep 17 00:00:00 2001 From: allen <294931812@qq.com> Date: Wed, 26 Jan 2022 15:48:39 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20window=E4=B8=8A=E6=9A=B4=E9=9C=B2se?= =?UTF-8?q?ssionId=EF=BC=8C=E4=BB=A5=E4=BE=BF=E4=B8=8E=E5=88=AB=E7=9A=84?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/web-performance/src/index.ts | 1 + packages/web-performance/src/types/index.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/web-performance/src/index.ts b/packages/web-performance/src/index.ts index 99b4d1a9..8ee0d2b7 100644 --- a/packages/web-performance/src/index.ts +++ b/packages/web-performance/src/index.ts @@ -50,6 +50,7 @@ class WebVitals implements IWebVitals { this.immediately = immediately const sessionId = generateUniqueID() + window.__monitor_sessionId__ = sessionId reporter = createReporter(sessionId, appId, version, reportCallback) metricsStore = new MetricsStore() diff --git a/packages/web-performance/src/types/index.ts b/packages/web-performance/src/types/index.ts index fc07b4dd..88a18b6f 100644 --- a/packages/web-performance/src/types/index.ts +++ b/packages/web-performance/src/types/index.ts @@ -131,5 +131,6 @@ declare global { // Build flags: __monitor_xhr__: boolean __monitor_fetch__: boolean + __monitor_sessionId__: string } }