2024-07-02 15:09:48 +08:00
|
|
|
import { getCookie } from "cookies-next";
|
2024-07-06 11:05:19 +08:00
|
|
|
import { get } from "./storeInfo";
|
2024-07-02 15:09:48 +08:00
|
|
|
export default function baseRequest() {
|
|
|
|
const token = getCookie("token");
|
2024-07-06 11:05:19 +08:00
|
|
|
const accountCookie = get("account");
|
|
|
|
const account = accountCookie === undefined ? {} : accountCookie;
|
2024-07-02 15:09:48 +08:00
|
|
|
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,
|
|
|
|
};
|
2024-07-17 16:58:27 +08:00
|
|
|
console.log("baseRequest",baseRequest)
|
2024-07-02 15:09:48 +08:00
|
|
|
return baseRequest;
|
|
|
|
}
|