mirror of
https://github.com/PlayEdu/frontend.git
synced 2025-06-09 04:16:19 +08:00
视频播放页面顶部优化
This commit is contained in:
parent
f5ba28c435
commit
7666e64f78
12
src/compenents/private-route/index.tsx
Normal file
12
src/compenents/private-route/index.tsx
Normal file
@ -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<PropInterface> = ({ Component }) => {
|
||||||
|
return getToken() ? Component : <Navigate to="/login" replace={true} />;
|
||||||
|
};
|
||||||
|
export default PrivateRoute;
|
@ -12,7 +12,8 @@
|
|||||||
right: 0;
|
right: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
background: rgba(255, 255, 255, 0.1);
|
background: #262634;
|
||||||
|
z-index: 100;
|
||||||
.box {
|
.box {
|
||||||
width: 62.5%;
|
width: 62.5%;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user