当前位置:网站首页>umi3 权限路由PrivateRoute未执行
umi3 权限路由PrivateRoute未执行
2022-08-02 03:27:00 【weixin_41779718】
在.umirc.ts中加上 wrappers: [’@/pages/routes/PrivateRoute.js’]
/pages/routes/PrivateRoute.js
import {
router } from 'dva';
const {
Redirect, Switch, Route } = router
const AuthRouter = (props) => {
console.log(props);
const {
route } = props;
const {
component:Component } = route;
return (
//true ? <Route {...route} /> : <Redirect to="/login" />
//这个也可以,跟下边的二选一,否则会报错
<Route render={
props => {
return false ? <Component {
...props } /> : <Redirect to="/login" />
}} />
)
}
export default AuthRouter;
边栏推荐
- A code audit notes (CVE - 2018-12613 phpmyadmin file contains loopholes)
- 自定义ViewGroup实现搜索栏历史记录流式布局
- Pycharm packages the project as an exe file
- 完整安装 Laravel-Admin 框架
- Command Execution Vulnerability
- Eric target penetration test complete tutorial
- 还原最真实、最全面的一线大厂面试题
- A network security guinea pig's learning path - scripting of advanced usage of nmap
- The first time to tear the code by hand, how to solve the problem of full arrangement
- 账务处理程序、记账凭证账务处理程序、汇总记账凭证账务处理程序、科目汇总表账务处理程序、会计信息化概述、信息化环境下会计账务处理的基本要求(此章出1道小题)
猜你喜欢

The shooting range that web penetration must play - DVWA shooting range 1 (centos8.2+phpstudy installation environment)

uniapp发布到微信小程序:分包、删减代码全过程

OPENSSL基本实验以及OPENSSL详解

二舅为什么能刷屏?这三件事对企业公关的启示

清理c盘爆满告急,C盘清理

快速搭建一个网关服务,动态路由、鉴权的流程,看完秒会(含流程图)

A network security guinea pig's learning path - scripting of advanced usage of nmap

The first time to tear the code by hand, how to solve the problem of full arrangement

The CTF introductory notes of SQL injection

关于我的数学建模~
随机推荐
laravel-admin 列表图片点击放大
财产清查概述、 全面清查的情况、局部清查的情况、财产清查的方法、财产清查结果的处理
机器学习1
MVC,MVP和MVVM架构解析
php中魔术方法详解
Windows下MySQL数据库报“ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost:8000‘ (10061)”错误解决
php的curl函数模拟post数据提交,速度非常慢
ReentrantLock的使用和原理详解
浅谈性能优化:APP的启动流程分析与优化
laravel 查询数据库获取结果如何判断是否为空?
The first time to tear the code by hand, how to solve the problem of full arrangement
Laravel打印执行的SQL语句
公司产品太多了,怎么实现一次登录产品互通?
一分钟get:缓存穿透、缓存击穿、缓存雪崩
pytorch:保存和加载模型
svg图片实战:自定义view打造中国地图
web安全之目录遍历
文件上传漏洞
Kotlin - 静态方法
文件包含漏洞