当前位置:网站首页>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;
边栏推荐
- Offensive and defensive world - novice MISC area 1-12
- How to calculate the distance between two points on the earth (with formula derivation)
- Laravel 登录,中间件和路由分组
- 账务处理程序、记账凭证账务处理程序、汇总记账凭证账务处理程序、科目汇总表账务处理程序、会计信息化概述、信息化环境下会计账务处理的基本要求(此章出1道小题)
- Sensitive information leakage
- 关于我的项目-实现一个数据库~
- Binder机制详解(二)
- (2) Sequence structures, Boolean values of objects, selection structures, loop structures, lists, dictionaries, tuples, sets
- uniapp | Compilation error after updating with npm update
- 英语每日打卡
猜你喜欢

CSRF(跨站请求伪造)

CTF entry md5

Offensive and defensive world - novice MISC area 1-12

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

账务处理程序、记账凭证账务处理程序、汇总记账凭证账务处理程序、科目汇总表账务处理程序、会计信息化概述、信息化环境下会计账务处理的基本要求(此章出1道小题)

Laravel 登录,中间件和路由分组

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

云安全笔记:云原生全链路加密

解密:链动2+1的商业模式

2021-09-04 最简单的Golang定时器应用以及最简单的协程入门儿
随机推荐
SATA M2 SSD 无法安装系统的解决方法
Sensitive information leakage
面试必备:Android性能分析与优化实战进阶手册
Binder机制详解(一)
MVC,MVP和MVVM架构解析
会计凭证概述、原始凭证、原始凭证的种类、原始凭证的基本内容、原始凭证的填制要求、原始凭证的审核
张量乘积—实验作业
什么是广告电商商业模式?这几个门派告诉你
2022年中高级 Android 大厂面试秘籍,为你保驾护航金九银十,直通大厂
kotlin语法总结(一)
[Hello World教程] 使用HBuilder和Uni-app 生成一个简单的微信小程序DEMO
战场:3(双子叶植物)vulnhub走读
Laravel随笔记录
关于我的数学建模~
关于我的项目-微信小程序2(uniapp->wx小程序)
Debian 12 Bookworm 尝鲜记
重点考:金融资产概述、交易性金融资产的概念、交易性金融资产的账务处理(取得、持有。出售)、
SQL注入(6)
关于我的项目-实现一个数据库~
hackmyvm: kitty walkthrough