feat: 修复打包报错问题

This commit is contained in:
landaiqing
2024-07-13 00:06:43 +08:00
parent 6ec4a92853
commit 4a3809e959
9 changed files with 22 additions and 23 deletions

View File

@@ -1,7 +1,7 @@
/** @format */
import matchAuth from "./matchRouter.ts";
import { Navigate, useLocation } from "react-router-dom";
import { message } from "antd";
// import { message } from "antd";
import { getStorageFromKey } from "@/utils/localStorage/config.ts";
import React from "react";
export default function AuthRoute(props: { children: React.ReactNode }) {
@@ -32,14 +32,14 @@ export default function AuthRoute(props: { children: React.ReactNode }) {
return <Navigate to="/404" />;
}
if (!isLogin) {
message
.open({
content: "请先登录!",
type: "warning",
})
.then();
return <Navigate to="/login" />;
}
// if (!isLogin) {
// message
// .open({
// content: "请先登录!",
// type: "warning",
// })
// .then();
// return <Navigate to="/login" />;
// }
return props.children;
}