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
3c03f222
Commit
3c03f222
authored
Jan 13, 2018
by
afc163
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix firefox error, close #677
parent
c3dfe2eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
src/components/Authorized/CheckPermissions.js
src/components/Authorized/CheckPermissions.js
+6
-1
No files found.
src/components/Authorized/CheckPermissions.js
View file @
3c03f222
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
PromiseRender
from
'
./PromiseRender
'
;
import
PromiseRender
from
'
./PromiseRender
'
;
import
{
CURRENT
}
from
'
./index
'
;
import
{
CURRENT
}
from
'
./index
'
;
function
isPromise
(
obj
)
{
return
!!
obj
&&
(
typeof
obj
===
'
object
'
||
typeof
obj
===
'
function
'
)
&&
typeof
obj
.
then
===
'
function
'
;
}
/**
/**
* ιη¨ζιζ£ζ₯ζΉζ³
* ιη¨ζιζ£ζ₯ζΉζ³
* Common check permissions method
* Common check permissions method
...
@@ -32,7 +37,7 @@ const checkPermissions = (authority, currentAuthority, target, Exception) => {
...
@@ -32,7 +37,7 @@ const checkPermissions = (authority, currentAuthority, target, Exception) => {
}
}
// Promise ε€η
// Promise ε€η
if
(
authority
.
constructor
.
name
===
'
Promise
'
)
{
if
(
isPromise
(
authority
)
)
{
return
()
=>
(
return
()
=>
(
<
PromiseRender
ok
=
{
target
}
error
=
{
Exception
}
promise
=
{
authority
}
/
>
<
PromiseRender
ok
=
{
target
}
error
=
{
Exception
}
promise
=
{
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