|
@@ -5,6 +5,7 @@ import { useSearchStore } from "@/stores/useSearchStore";
|
|
|
import { useUserInfoStore } from "@/stores/useUserInfoStore";
|
|
|
import { useWalletStore } from "@/stores/useWalletStore";
|
|
|
import { CenterPopup } from "antd-mobile";
|
|
|
+import dayjs from "dayjs";
|
|
|
import Cookies from "js-cookie";
|
|
|
import { useTranslations } from "next-intl";
|
|
|
import { FC, PropsWithChildren, useState } from "react";
|
|
@@ -28,15 +29,18 @@ const ModalCom: FC<PropsWithChildren<ItemComProps>> = () => {
|
|
|
const [visible, setVisible] = useState(false);
|
|
|
const logoutRequest = async () => {
|
|
|
let res = await getLogoutApi();
|
|
|
+ const isClearPromotion = dayjs().isSame(sessionStorage.getItem("isClosePromotion"), "days");
|
|
|
if (res.code == 200) {
|
|
|
restGlobal();
|
|
|
resetSearch();
|
|
|
restWalletStore();
|
|
|
localStorage.clear();
|
|
|
- sessionStorage.clear();
|
|
|
Cookies.remove("Token");
|
|
|
router.replace("/login");
|
|
|
}
|
|
|
+ if (!isClearPromotion) {
|
|
|
+ sessionStorage.clear();
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
const router = useRouter();
|