tiefen_space_h5/utils/baseRequest.js

18 lines
527 B
JavaScript

import { getCookie } from "cookies-next";
import { get } from "./storeInfo";
export default function baseRequest() {
const token = getCookie("token");
const accountCookie = get("account");
const account = accountCookie === undefined ? {} : accountCookie;
const mid = getCookie("mid");
const b_ts = new Date().getTime();
const baseRequest = {
b_mid: mid ? parseInt(mid, 10) : account?.mid,
b_ch: "h5",
b_ts: b_ts,
b_token: token,
};
console.log("baseRequest",baseRequest)
return baseRequest;
}