From 8e10d4a2533feba753a6748a4e82f6f1d0bc88aa Mon Sep 17 00:00:00 2001 From: landaiqing <3517283258@qq.com> Date: Mon, 22 Jul 2024 22:44:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Main/Bucket/components/QiniuDrawer.tsx | 2 +- src/components/Main/File/index.tsx | 4 ++-- .../Main/Settings/components/QiniuSettings.tsx | 2 +- src/router/useAuth.tsx | 9 +++++---- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/components/Main/Bucket/components/QiniuDrawer.tsx b/src/components/Main/Bucket/components/QiniuDrawer.tsx index 0ac9c72..94431e5 100644 --- a/src/components/Main/Bucket/components/QiniuDrawer.tsx +++ b/src/components/Main/Bucket/components/QiniuDrawer.tsx @@ -35,7 +35,7 @@ const QiniuDrawer = observer(() => { const bucketList = () => { return ( diff --git a/src/components/Main/File/index.tsx b/src/components/Main/File/index.tsx index 2741e28..6ae8d2d 100644 --- a/src/components/Main/File/index.tsx +++ b/src/components/Main/File/index.tsx @@ -56,7 +56,7 @@ import { import StorageIcon from "@/constant/stroage-icon.ts"; import { useNavigate } from "react-router-dom"; import Base64 from "base-64"; -const File: FunctionComponent = observer(() => { +const File: FunctionComponent = () => { const store = useStore("file"); const navigate = useNavigate(); const [files, setFiles] = useState([]); @@ -1046,5 +1046,5 @@ const File: FunctionComponent = observer(() => { ); -}); +}; export default observer(File); diff --git a/src/components/Main/Settings/components/QiniuSettings.tsx b/src/components/Main/Settings/components/QiniuSettings.tsx index a520f11..54f3f70 100644 --- a/src/components/Main/Settings/components/QiniuSettings.tsx +++ b/src/components/Main/Settings/components/QiniuSettings.tsx @@ -219,7 +219,7 @@ const QiniuSettings: React.FC = observer(() => { }; async function getAllConfigs() { - getAllQiniuConfigs(1).then((res: any) => { + getAllQiniuConfigs(userId).then((res: any) => { if (res && res.success && res.data) { setConfig(res.data); } diff --git a/src/router/useAuth.tsx b/src/router/useAuth.tsx index 9497186..46d5815 100644 --- a/src/router/useAuth.tsx +++ b/src/router/useAuth.tsx @@ -12,13 +12,14 @@ export default function AuthRoute(props: { children: React.ReactNode }) { const condition: boolean = (currentPath === "/login" && !isLogin) || currentPath === "/404" || - (currentPath === "register" && !isLogin) || - (currentPath === "forget" && !isLogin); + (currentPath === "/register" && !isLogin) || + (currentPath === "/forget" && !isLogin) || + (currentPath === "/" && !isLogin); // 登录后访问login const conditionWithLogin: boolean = (currentPath === "/login" && isLogin) || - (currentPath === "register" && isLogin) || - (currentPath === "forget" && isLogin); + (currentPath === "/register" && isLogin) || + (currentPath === "/forget" && isLogin); const findPath: any = matchAuth(currentPath); if (condition) {