From 9b5c67640a2ab6164aaf5dbbd2b275c650f69186 Mon Sep 17 00:00:00 2001 From: al Date: Wed, 24 Jul 2024 15:37:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E6=96=ADnavigator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/baseRequest.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/baseRequest.js b/utils/baseRequest.js index c90007b..b6fd476 100644 --- a/utils/baseRequest.js +++ b/utils/baseRequest.js @@ -11,7 +11,10 @@ export default function baseRequest() { b_ch: "h5", b_ts: b_ts, b_token: token, - b_did: navigator?.userAgent.slice(0,32), + b_did: + typeof window !== "undefined" && + typeof window.navigator !== "undefined" && + navigator?.userAgent.slice(0, 32), }; // console.log("baseRequest",baseRequest) return baseRequest;