判断navigator

This commit is contained in:
al 2024-07-24 15:37:48 +08:00
parent 0ce42b7506
commit 9b5c67640a
1 changed files with 4 additions and 1 deletions

View File

@ -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;