Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
2a70fe0d
Commit
2a70fe0d
authored
Mar 22, 2019
by
ιε°θͺ
Committed by
ιεΈ
Mar 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cancel default permissions (#3693)
parent
8b871219
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
6 deletions
+7
-6
config/router.config.js
config/router.config.js
+1
-1
src/layouts/BasicLayout.js
src/layouts/BasicLayout.js
+2
-2
src/models/menu.js
src/models/menu.js
+2
-2
src/pages/Authorized.js
src/pages/Authorized.js
+1
-0
src/utils/authority.js
src/utils/authority.js
+1
-1
No files found.
config/router.config.js
View file @
2a70fe0d
...
...
@@ -24,7 +24,7 @@ export default [
Routes
:
[
'
src/pages/Authorized
'
],
routes
:
[
// dashboard
{
path
:
'
/
'
,
redirect
:
'
/dashboard/analysis
'
},
{
path
:
'
/
'
,
redirect
:
'
/dashboard/analysis
'
,
authority
:
[
'
admin
'
,
'
user
'
]
},
{
path
:
'
/dashboard
'
,
name
:
'
dashboard
'
,
...
...
src/layouts/BasicLayout.js
View file @
2a70fe0d
...
...
@@ -48,7 +48,7 @@ class BasicLayout extends React.Component {
componentDidMount
()
{
const
{
dispatch
,
route
:
{
routes
,
authority
},
route
:
{
routes
,
path
,
authority
},
}
=
this
.
props
;
dispatch
({
type
:
'
user/fetchCurrent
'
,
...
...
@@ -58,7 +58,7 @@ class BasicLayout extends React.Component {
});
dispatch
({
type
:
'
menu/getMenuData
'
,
payload
:
{
routes
,
authority
},
payload
:
{
routes
,
path
,
authority
},
});
}
...
...
src/models/menu.js
View file @
2a70fe0d
...
...
@@ -109,8 +109,8 @@ export default {
effects
:
{
*
getMenuData
({
payload
},
{
put
})
{
const
{
routes
,
authority
}
=
payload
;
const
originalMenuData
=
memoizeOneFormatter
(
routes
,
authority
);
const
{
routes
,
authority
,
path
}
=
payload
;
const
originalMenuData
=
memoizeOneFormatter
(
routes
,
authority
,
path
);
const
menuData
=
filterMenuData
(
originalMenuData
);
const
breadcrumbNameMap
=
memoizeOneGetBreadcrumbNameMap
(
originalMenuData
);
yield
put
({
...
...
src/pages/Authorized.js
View file @
2a70fe0d
...
...
@@ -21,6 +21,7 @@ function AuthComponent({ children, location, routerData, status }) {
});
return
authorities
;
};
return
(
<
Authorized
authority
=
{
getRouteAuthority
(
location
.
pathname
,
routerData
)}
...
...
src/utils/authority.js
View file @
2a70fe0d
...
...
@@ -13,7 +13,7 @@ export function getAuthority(str) {
if
(
typeof
authority
===
'
string
'
)
{
return
[
authority
];
}
return
authority
||
[
'
admin
'
]
;
return
authority
;
}
export
function
setAuthority
(
authority
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment