Я использую шаблонную панель инструментов и добавил страницу входа в систему.Когда я возвращаюсь http://localhost:3000, я хорошо перенаправлен на http://localhost:3000/login
Но когда я нажимаю в своем меню, чтобы перейти к профилю страницы (http://localhost:3000/use),, я переадресован на страницулогина (http://localhost:3000/login).
Я не понимаю проблему.
Мой основной файл маршрутов:
import Login from "views/authentification/LoginPage.jsx";
import Dashboard from "layouts/Dashboard/Dashboard.jsx";
const indexRoutes = [
{
path: "/login",
component: Login
},
{
path: "/dashboard",
component: Dashboard
},
{
redirect: true,
path: "/",
to: "/login"
}
];
export default indexRoutes;
Мой файл панели инструментов маршрутов:
// @material-ui/icons
import Dashboard from "@material-ui/icons/Dashboard";
import Person from "@material-ui/icons/Person";
// import ContentPaste from "@material-ui/icons/ContentPaste";
import LibraryBooks from "@material-ui/icons/LibraryBooks";
import BubbleChart from "@material-ui/icons/BubbleChart";
import LocationOn from "@material-ui/icons/LocationOn";
import Notifications from "@material-ui/icons/Notifications";
import Unarchive from "@material-ui/icons/Unarchive";
// core components/views
import DashboardPage from "views/Dashboard/Dashboard.jsx";
import UserProfile from "views/UserProfile/UserProfile.jsx";
import TableList from "views/TableList/TableList.jsx";
import Typography from "views/Typography/Typography.jsx";
import Icons from "views/Icons/Icons.jsx";
import Maps from "views/Maps/Maps.jsx";
import NotificationsPage from "views/Notifications/Notifications.jsx";
import UpgradeToPro from "views/UpgradeToPro/UpgradeToPro.jsx";
const dashboardRoutes = [
{
path: "/dashboard",
sidebarName: "Dashboard",
navbarName: "Material Dashboard",
icon: Dashboard,
component: DashboardPage
},
{
path: "/user",
exact: true,
sidebarName: "User Profile",
navbarName: "Profile",
icon: Person,
component: UserProfile
},
{
path: "/table",
sidebarName: "Table List",
navbarName: "Table List",
icon: "content_paste",
component: TableList
},
..........
];
export default dashboardRoutes;