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
c5929815
Commit
c5929815
authored
Jan 10, 2018
by
afc163
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:ant-design/ant-design-pro
parents
cf41067c
57767505
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
85 additions
and
11 deletions
+85
-11
package.json
package.json
+2
-2
src/components/Authorized/demo/basic.md
src/components/Authorized/demo/basic.md
+2
-2
src/components/Authorized/demo/secured.md
src/components/Authorized/demo/secured.md
+73
-0
src/components/Ellipsis/index.js
src/components/Ellipsis/index.js
+1
-1
src/components/GlobalFooter/demo/basic.md
src/components/GlobalFooter/demo/basic.md
+1
-1
src/layouts/UserLayout.js
src/layouts/UserLayout.js
+6
-5
No files found.
package.json
View file @
c5929815
...
@@ -6,8 +6,8 @@
...
@@ -6,8 +6,8 @@
"scripts"
:
{
"scripts"
:
{
"precommit"
:
"npm run lint-staged"
,
"precommit"
:
"npm run lint-staged"
,
"start"
:
"cross-env DISABLE_ESLINT=true roadhog dev"
,
"start"
:
"cross-env DISABLE_ESLINT=true roadhog dev"
,
"start:no-proxy"
:
"cross-env NO_PROXY=true roadhog dev"
,
"start:no-proxy"
:
"cross-env NO_PROXY=true
DISABLE_ESLINT=true
roadhog dev"
,
"build"
:
"roadhog build"
,
"build"
:
"
cross-env DISABLE_ESLINT=true
roadhog build"
,
"site"
:
"roadhog-api-doc static && gh-pages -d dist"
,
"site"
:
"roadhog-api-doc static && gh-pages -d dist"
,
"analyze"
:
"roadhog build --analyze"
,
"analyze"
:
"roadhog build --analyze"
,
"lint:style"
:
"stylelint
\"
src/**/*.less
\"
--syntax less"
,
"lint:style"
:
"stylelint
\"
src/**/*.less
\"
--syntax less"
,
...
...
src/components/Authorized/demo/basic.md
View file @
c5929815
...
@@ -36,7 +36,7 @@ ReactDOM.render(
...
@@ -36,7 +36,7 @@ ReactDOM.render(
<
Authorized
authority
=
{
havePermissionAsync
}
noMatch
=
{
noMatch
}
>
<
Authorized
authority
=
{
havePermissionAsync
}
noMatch
=
{
noMatch
}
>
<
Alert
message
=
"Use Promise as a parameter passed!"
type
=
"success"
showIcon
/>
<
Alert
message
=
"Use Promise as a parameter passed!"
type
=
"success"
showIcon
/>
</
Authorized
>
</
Authorized
>
</
div
>
</
div
>
,
mountNode
,
mountNode
);
);
```
```
src/components/Authorized/demo/secured.md
0 → 100644
View file @
c5929815
---
order
:
1
title
:
zh-CN
:
注解
en-US
:
secured
---
```
jsx
import
RenderAuthorized
from
'
ant-design-pro/lib/Authorized
'
;
import
{
Alert
}
from
'
antd
'
;
const
{
Secured
}
=
RenderAuthorized
(
'
user
'
);
const
noMatch
=
<
Alert
message
=
"No permission."
type
=
"error"
showIcon
/>;
const
havePermission
=
()
=>
{
return
false
;
};
const
havePermissionAsync
=
new
Promise
((
resolve
,
reject
)
=>
{
// Call reslove on behalf of passed
setTimeout
(()
=>
reslove
(),
1000
);
});
@
Secured
(
'
admin
'
,
noMatch
)
class
TestSecuredString
extends
React
.
Component
{
render
()
{
<
Alert
message
=
"user Passed!"
type
=
"success"
showIcon
/>;
}
}
@
Secured
([
'
user
'
,
'
admin
'
],
noMatch
)
class
TestSecuredArray
extends
React
.
Component
{
render
()
{
<
Alert
message
=
"Use Array as a parameter passed!"
type
=
"success"
showIcon
/>;
}
}
@
Secured
(
havePermission
,
noMatch
)
class
TestSecuredFunction
extends
React
.
Component
{
render
()
{
<
Alert
message
=
"Use function as a parameter passed!"
type
=
"success"
showIcon
/>;
}
}
@
Secured
(
havePermissionAsync
,
noMatch
)
class
TestSecuredPromise
extends
React
.
Component
{
render
()
{
<
Alert
message
=
"Use Promise as a parameter passed!"
type
=
"success"
showIcon
/>;
}
}
ReactDOM
.
render
(
<
div
>
<
TestSecuredString
/>
<
TestSecuredArray
/>
<
TestSecuredFunction
/>
<
TestSecuredPromise
/>
</
div
>,
mountNode
,
);
```
src/components/Ellipsis/index.js
View file @
c5929815
...
@@ -171,7 +171,7 @@ export default class Ellipsis extends Component {
...
@@ -171,7 +171,7 @@ export default class Ellipsis extends Component {
<
div
id
=
{
id
}
className
=
{
cls
}
{...
restProps
}
>
<
div
id
=
{
id
}
className
=
{
cls
}
{...
restProps
}
>
<
style
>
{
style
}
<
/style
>
<
style
>
{
style
}
<
/style
>
{
{
tooltip
?
(
<
Tooltip
title
=
{
text
}
>
{
children
}
<
/Tooltip>
)
: childre
n
tooltip
?
(
<
Tooltip
title
=
{
children
}
>
{
children
}
<
/Tooltip>
)
: childre
n
}
}
<
/div>
)
;
<
/div>
)
;
}
}
...
...
src/components/GlobalFooter/demo/basic.md
View file @
c5929815
...
@@ -15,7 +15,7 @@ const links = [{
...
@@ -15,7 +15,7 @@ const links = [{
title
:
'
帮助
'
,
title
:
'
帮助
'
,
href
:
''
,
href
:
''
,
},
{
},
{
key
:
'
github
'
key
:
'
github
'
,
title
:
<
Icon
type
=
"github"
/>,
title
:
<
Icon
type
=
"github"
/>,
href
:
'
https://github.com/ant-design/ant-design-pro
'
,
href
:
'
https://github.com/ant-design/ant-design-pro
'
,
blankTarget
:
true
,
blankTarget
:
true
,
...
...
src/layouts/UserLayout.js
View file @
c5929815
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
Link
,
Route
}
from
'
dva/router
'
;
import
{
Link
,
R
edirect
,
Switch
,
R
oute
}
from
'
dva/router
'
;
import
DocumentTitle
from
'
react-document-title
'
;
import
DocumentTitle
from
'
react-document-title
'
;
import
{
Icon
}
from
'
antd
'
;
import
{
Icon
}
from
'
antd
'
;
import
GlobalFooter
from
'
../components/GlobalFooter
'
;
import
GlobalFooter
from
'
../components/GlobalFooter
'
;
...
@@ -47,8 +47,8 @@ class UserLayout extends React.PureComponent {
...
@@ -47,8 +47,8 @@ class UserLayout extends React.PureComponent {
<
/div
>
<
/div
>
<
div
className
=
{
styles
.
desc
}
>
Ant
Design
是西湖区最具影响力的
Web
设计规范
<
/div
>
<
div
className
=
{
styles
.
desc
}
>
Ant
Design
是西湖区最具影响力的
Web
设计规范
<
/div
>
<
/div
>
<
/div
>
{
<
Switch
>
getRoutes
(
match
.
path
,
routerData
).
map
(
item
=>
{
getRoutes
(
match
.
path
,
routerData
).
map
(
item
=>
(
(
<
Route
<
Route
key
=
{
item
.
key
}
key
=
{
item
.
key
}
...
@@ -57,8 +57,9 @@ class UserLayout extends React.PureComponent {
...
@@ -57,8 +57,9 @@ class UserLayout extends React.PureComponent {
exact
=
{
item
.
exact
}
exact
=
{
item
.
exact
}
/
>
/
>
)
)
)
)}
}
<
Redirect
exact
from
=
"
/user
"
to
=
"
/user/login
"
/>
<
/Switch
>
<
GlobalFooter
className
=
{
styles
.
footer
}
links
=
{
links
}
copyright
=
{
copyright
}
/
>
<
GlobalFooter
className
=
{
styles
.
footer
}
links
=
{
links
}
copyright
=
{
copyright
}
/
>
<
/div
>
<
/div
>
<
/DocumentTitle
>
<
/DocumentTitle
>
...
...
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