chore: fix

This commit is contained in:
Tristan Yang
2024-12-29 08:00:59 +08:00
parent 0e93379fc9
commit 98776b5e54
+2 -2
View File
@@ -3,7 +3,7 @@ import { fetchBaseQuery } from "@reduxjs/toolkit/query";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { getLocalAuthData } from "@/utils"; import { getLocalAuthData } from "@/utils";
import BASE_URL, { tokenHeader } from "../config"; import BASE_URL, { tokenHeader, IS_OFFICIAL_DEMO } from "../config";
import { resetAuthData, updateToken } from "../slices/auth.data"; import { resetAuthData, updateToken } from "../slices/auth.data";
const whiteList = [ const whiteList = [
@@ -41,7 +41,7 @@ const baseQuery = fetchBaseQuery({
baseUrl: BASE_URL, baseUrl: BASE_URL,
prepareHeaders: (headers, { endpoint }) => { prepareHeaders: (headers, { endpoint }) => {
const { token } = getLocalAuthData(); const { token } = getLocalAuthData();
if ("crypto" in window) { if (IS_OFFICIAL_DEMO && "crypto" in window) {
const uuid = window.crypto.randomUUID(); const uuid = window.crypto.randomUUID();
headers.set("request_uuid", uuid); headers.set("request_uuid", uuid);
} }