当前位置:网站首页>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;
边栏推荐
猜你喜欢
svg图片实战:自定义view打造中国地图
链动2+1无限循环系统,2022年起盘成功率超高的模式
The shooting range that web penetration must play - DVWA shooting range 1 (centos8.2+phpstudy installation environment)
树莓派4b安装win11/10过程全教程(附蓝屏inaccessible boot device解决办法)
C language uses stack to calculate infix expressions
hackmyvm: kitty walkthrough
张量乘积—实验作业
CSRF (Cross Site Request Forgery)
How to log in to Alibaba Cloud server using the admin account
Dcat Admin 关闭代码生成器 登录指定地址
随机推荐
会计凭证概述、原始凭证、原始凭证的种类、原始凭证的基本内容、原始凭证的填制要求、原始凭证的审核
Larave 自定义公共函数以及引入使用
mysql 原生语句点滴学习记录
关于我的大创、论文~
政府会计的概念、政府会计标准体系、政府会计的特点(会形成小考点)、政府会计要素及其确认和计量、政府预算会计要素、政府财务会计要素
How to calculate the distance between two points on the earth (with formula derivation)
CSRF (Cross Site Request Forgery)
[Hello World教程] 使用HBuilder和Uni-app 生成一个简单的微信小程序DEMO
How to determine the direction based on two coordinate points on the map
考(重点理解哪些属于其他货币资金)、其他货币资金的内容、其他货币资金的账务处理(银行汇票存款、银行本票存款、信用卡存款、信用证保证金存款、存出投资款、外埠存款)
同时安装VirtualBox和VMware,虚拟机如何上网
Uniapp | compatibility problems in the development of (to be continued)
PHP deserialization vulnerability
聊聊MySQL的10大经典错误
张量乘积—实验作业
uniapp发布到微信小程序:分包、删减代码全过程
阿里技术官手码12W字面试小册
树莓派4b安装win11/10过程全教程(附蓝屏inaccessible boot device解决办法)
synchronized锁原理详解
公司产品太多了,怎么实现一次登录产品互通?