Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
ds147000
/
react-project-storage
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit df27d01e
authored
Jul 21, 2020
by
郑永杰
Browse files
Options
Browse Files
Download
Plain Diff
合并冲突
2 parents
ed88d170
828bafae
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
2 deletions
src/components/Layout/view.js
src/router/router-view.js
src/store/modules/route/connect.js
src/store/modules/user/index.js
src/components/Layout/view.js
View file @
df27d01
...
...
@@ -40,7 +40,7 @@ const Page = ({ children, userRoute = [], location }) => {
<
Menu
theme
=
{
theme
}
mode
=
"inline"
selectedKeys
=
{
index
}
>
{
userRoute
.
map
(
e
=>
{
return
(
<
SubMenu
key
=
{
e
.
name
}
icon
=
{
<
img
className
=
"icon"
src
=
{
APP
.
STATIS_URL
+
e
.
icon
}
alt
=
""
/>
}
title
=
{
e
.
name
}
>
<
SubMenu
key
=
{
e
.
name
}
icon
=
{
<
img
className
=
"icon"
alt
=
"图标"
src
=
{
APP
.
STATIS_URL
+
e
.
icon
}
/>} title={e.name}
>
{
e
.
childMenus
.
map
(
child
=>
<
Item
key
=
{
child
.
url
}
url
=
{
child
.
url
}
>
{
child
.
name
}
<
/Item>
)
}
<
/SubMenu
>
)
...
...
src/router/router-view.js
View file @
df27d01
...
...
@@ -10,7 +10,7 @@ import { getAllRouter } from '../libs/utilts'
/** 获取全部路由的路径 */
const
getAllRouterName
=
route
=>
route
.
map
(
e
=>
e
.
url
)
const
RouterView
=
({
basisRoute
=
[],
serviceRoute
=
[],
userRoute
=
[]
})
=>
{
const
RouterView
=
({
basisRoute
=
[],
serviceRoute
=
[],
userRoute
=
[]
,
userSatatus
})
=>
{
const
[
openRoute
,
setOpenRoute
]
=
useState
([])
useEffect
(()
=>
{
...
...
@@ -47,6 +47,7 @@ const RouterView = ({basisRoute = [], serviceRoute = [], userRoute = [] }) => {
<
Layout
>
{
basisRoute
.
map
(
e
=>
<
Route
path
=
{
e
.
url
}
exact
=
{
e
.
exact
}
component
=
{
e
.
component
}
key
=
{
e
.
url
}
/>
)
}
{
openRoute
.
map
(
e
=>
<
Route
path
=
{
e
.
url
}
exact
=
{
e
.
exact
}
component
=
{
e
.
component
}
key
=
{
e
.
url
}
/>
)
}
<
/Layout
>
<
/Switch>
)
...
...
src/store/modules/route/connect.js
View file @
df27d01
...
...
@@ -2,6 +2,7 @@ import { connect } from 'react-redux'
const
mapState
=
state
=>
({
userRoute
:
state
.
route
.
route
,
userSatatus
:
state
.
user
.
userSatatus
})
const
mapDispatch
=
dispatch
=>
({
...
...
src/store/modules/user/index.js
0 → 100644
View file @
df27d01
export
default
{
state
:
{
userSatatus
:
false
},
reducers
:
{
loginSucess
()
{
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment