Commit d867d7e7 authored by jim's avatar jim

Modify the document in the mistakes

parent bb85b06d
...@@ -5,6 +5,8 @@ title: ...@@ -5,6 +5,8 @@ title:
en-US: Basic en-US: Basic
--- ---
Authorized demo used
```jsx ```jsx
import RenderAuthorized from 'ant-design-pro/lib/Authorized'; import RenderAuthorized from 'ant-design-pro/lib/Authorized';
import { Alert } from 'antd'; import { Alert } from 'antd';
...@@ -18,8 +20,8 @@ const havePermission = () => { ...@@ -18,8 +20,8 @@ const havePermission = () => {
}; };
const havePermissionAsync = new Promise((resolve,reject)=>{ const havePermissionAsync = new Promise((resolve,reject)=>{
// Call reslove on behalf of passed // Call resolve on behalf of passed
setTimeout(()=>reslove(),1000) setTimeout( ()=> resolve() , 1000)
}); });
ReactDOM.render( ReactDOM.render(
...@@ -30,7 +32,7 @@ ReactDOM.render( ...@@ -30,7 +32,7 @@ ReactDOM.render(
<Authorized authority={['user','admin']} noMatch={noMatch}> <Authorized authority={['user','admin']} noMatch={noMatch}>
<Alert message="Use Array as a parameter passed!" type="success" showIcon /> <Alert message="Use Array as a parameter passed!" type="success" showIcon />
</Authorized> </Authorized>
<Authorized authority={Havepermission} noMatch={noMatch}> <Authorized authority={havePermission} noMatch={noMatch}>
<Alert message="Use function as a parameter passed!" type="success" showIcon /> <Alert message="Use function as a parameter passed!" type="success" showIcon />
</Authorized> </Authorized>
<Authorized authority={havePermissionAsync} noMatch={noMatch}> <Authorized authority={havePermissionAsync} noMatch={noMatch}>
......
...@@ -5,6 +5,8 @@ title: ...@@ -5,6 +5,8 @@ title:
en-US: secured en-US: secured
--- ---
secured demo used
```jsx ```jsx
import RenderAuthorized from 'ant-design-pro/lib/Authorized'; import RenderAuthorized from 'ant-design-pro/lib/Authorized';
import { Alert } from 'antd'; import { Alert } from 'antd';
...@@ -17,8 +19,8 @@ const havePermission = () => { ...@@ -17,8 +19,8 @@ const havePermission = () => {
}; };
const havePermissionAsync = new Promise((resolve, reject) => { const havePermissionAsync = new Promise((resolve, reject) => {
// Call reslove on behalf of passed // Call resolve on behalf of passed
setTimeout(() => reslove(), 1000); setTimeout(() => resolve(), 1000);
}); });
@Secured('admin', noMatch) @Secured('admin', noMatch)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment