From 7666e64f78a0613aa0a64c9eb2b515c5c90e01aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BA=E7=8B=A8?= <18119604035@163.com> Date: Mon, 8 May 2023 09:59:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=92=AD=E6=94=BE=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E9=A1=B6=E9=83=A8=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/compenents/private-route/index.tsx | 12 ++++++++++++ src/pages/course/video.module.scss | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 src/compenents/private-route/index.tsx diff --git a/src/compenents/private-route/index.tsx b/src/compenents/private-route/index.tsx new file mode 100644 index 0000000..75af9ac --- /dev/null +++ b/src/compenents/private-route/index.tsx @@ -0,0 +1,12 @@ +import React from "react"; +import { getToken } from "../../utils/index"; +import { Navigate } from "react-router-dom"; + +interface PropInterface { + Component: any; +} + +const PrivateRoute: React.FC = ({ Component }) => { + return getToken() ? Component : ; +}; +export default PrivateRoute; diff --git a/src/pages/course/video.module.scss b/src/pages/course/video.module.scss index c3a07e1..c6b13e6 100644 --- a/src/pages/course/video.module.scss +++ b/src/pages/course/video.module.scss @@ -12,7 +12,8 @@ right: 0; width: 100%; height: 60px; - background: rgba(255, 255, 255, 0.1); + background: #262634; + z-index: 100; .box { width: 62.5%; height: 60px;