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
5a9d3c07
Unverified
Commit
5a9d3c07
authored
Jan 17, 2019
by
陈小聪
Committed by
GitHub
Jan 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: error-processing-request (#3402)
* Close: #3398 * error authority is undefined
parent
bdc92d5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
src/app.js
src/app.js
+11
-5
No files found.
src/app.js
View file @
5a9d3c07
...
@@ -8,11 +8,12 @@ export const dva = {
...
@@ -8,11 +8,12 @@ export const dva = {
},
},
};
};
let
authRoutes
=
null
;
let
authRoutes
=
{}
;
function
ergodicRoutes
(
routes
,
authKey
,
authority
)
{
function
ergodicRoutes
(
routes
,
authKey
,
authority
)
{
routes
.
forEach
(
element
=>
{
routes
.
forEach
(
element
=>
{
if
(
element
.
path
===
authKey
)
{
if
(
element
.
path
===
authKey
)
{
if
(
!
element
.
authority
)
element
.
authority
=
[];
// eslint-disable-line
Object
.
assign
(
element
.
authority
,
authority
||
[]);
Object
.
assign
(
element
.
authority
,
authority
||
[]);
}
else
if
(
element
.
routes
)
{
}
else
if
(
element
.
routes
)
{
ergodicRoutes
(
element
.
routes
,
authKey
,
authority
);
ergodicRoutes
(
element
.
routes
,
authKey
,
authority
);
...
@@ -31,8 +32,13 @@ export function patchRoutes(routes) {
...
@@ -31,8 +32,13 @@ export function patchRoutes(routes) {
export
function
render
(
oldRender
)
{
export
function
render
(
oldRender
)
{
fetch
(
'
/api/auth_routes
'
)
fetch
(
'
/api/auth_routes
'
)
.
then
(
res
=>
res
.
json
())
.
then
(
res
=>
res
.
json
())
.
then
(
ret
=>
{
.
then
(
authRoutes
=
ret
;
ret
=>
{
oldRender
();
authRoutes
=
ret
;
});
oldRender
();
},
()
=>
{
oldRender
();
}
);
}
}
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