perf: token

This commit is contained in:
archer
2023-08-05 11:32:43 +08:00
parent eb5a252654
commit 761ae74b0a
13 changed files with 69 additions and 45 deletions

View File

@@ -3,7 +3,7 @@ import { Box, Flex, useTheme } from '@chakra-ui/react';
import { useGlobalStore } from '@/store/global';
import { useRouter } from 'next/router';
import dynamic from 'next/dynamic';
import { clearCookie } from '@/utils/user';
import { clearToken } from '@/utils/user';
import { useUserStore } from '@/store/user';
import { useConfirm } from '@/hooks/useConfirm';
import PageContainer from '@/components/PageContainer';
@@ -77,7 +77,7 @@ const Account = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
(tab: string) => {
if (tab === TabEnum.loginout) {
openConfirm(() => {
clearCookie();
clearToken();
setUserInfo(null);
router.replace('/login');
})();