|
@@ -16,6 +16,8 @@ import PageLoadable from '../components/common/pageLoad/PageLoadable'
|
|
|
|
|
|
|
|
const PageNotFound = PageLoadable(
|
|
const PageNotFound = PageLoadable(
|
|
|
import(/* webpackChunkName:'common' */'@/pages/common/PageNotFound'))
|
|
import(/* webpackChunkName:'common' */'@/pages/common/PageNotFound'))
|
|
|
|
|
+const AccessDenied = PageLoadable(
|
|
|
|
|
+ import(/* webpackChunkName:'common' */'@/pages/common/AccessDenied'))
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 自定义页面返回事件拦截框
|
|
* 自定义页面返回事件拦截框
|
|
@@ -48,7 +50,8 @@ class Routes extends React.Component {
|
|
|
<div style={{ width: '100%', height: '100%' }}>
|
|
<div style={{ width: '100%', height: '100%' }}>
|
|
|
<Switch>
|
|
<Switch>
|
|
|
{/* 默认页面、404页面 */}
|
|
{/* 默认页面、404页面 */}
|
|
|
- <Route path='/' component={PageNotFound}/>
|
|
|
|
|
|
|
+ <Route exact path='/' component={PageNotFound}/>
|
|
|
|
|
+ <Route exact path='/accessDenied' component={AccessDenied}/>
|
|
|
|
|
|
|
|
{/* 所有错误路由跳转页面 */}
|
|
{/* 所有错误路由跳转页面 */}
|
|
|
<Route render={() => (
|
|
<Route render={() => (
|
|
@@ -85,7 +88,7 @@ class Routes extends React.Component {
|
|
|
return <component {...props}/>
|
|
return <component {...props}/>
|
|
|
} else {
|
|
} else {
|
|
|
return <Redirect to={{
|
|
return <Redirect to={{
|
|
|
- pathname: '/authority',
|
|
|
|
|
|
|
+ pathname: '/accessDenied',
|
|
|
state: { from: props.location },
|
|
state: { from: props.location },
|
|
|
}}/>
|
|
}}/>
|
|
|
}
|
|
}
|
|
@@ -97,8 +100,9 @@ class Routes extends React.Component {
|
|
|
let mapStateToProps = (state) => ({
|
|
let mapStateToProps = (state) => ({
|
|
|
//Todo 挂载相关信息,如登录信息,权限信息等
|
|
//Todo 挂载相关信息,如登录信息,权限信息等
|
|
|
})
|
|
})
|
|
|
|
|
+let mapDispatchToProps = (dispatch) => ({})
|
|
|
|
|
|
|
|
-export default connect(mapStateToProps)(Routes)
|
|
|
|
|
|
|
+export default connect(mapStateToProps, mapDispatchToProps)(Routes)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|