baseRequest增加b_dt字段

This commit is contained in:
yezian 2024-12-25 18:53:37 +08:00
parent 17f58f0ade
commit f443aa0e80
1 changed files with 6 additions and 1 deletions

View File

@ -6,16 +6,21 @@ export default function baseRequest() {
const account = accountCookie === undefined ? {} : accountCookie;
const mid = getCookie("mid");
const b_ts = new Date().getTime();
let b_dt = 0;
if (/(iPad|iPhone|iPod)/gi.test(navigator.userAgent)) {
b_dt = 1;
}
const baseRequest = {
b_mid: mid ? parseInt(mid, 10) : account?.mid,
b_ch: "h5",
b_ts: b_ts,
b_dt: b_dt,
b_token: token,
b_did:
typeof window !== "undefined" &&
typeof window.navigator !== "undefined" &&
navigator?.userAgent.slice(0, 32),
};
// console.log("baseRequest",baseRequest)
// console.log("baseRequest", baseRequest);
return baseRequest;
}