update 开发文档
This commit is contained in:
@@ -1,43 +0,0 @@
|
||||
import { Auth } from 'components'
|
||||
import auth from 'components/authorized/handler'
|
||||
|
||||
/**
|
||||
* 简单的权限标识
|
||||
*/
|
||||
function foo1() {
|
||||
return <Auth auth="permissions:name">
|
||||
<a>连接</a>
|
||||
</Auth>
|
||||
}
|
||||
|
||||
/**
|
||||
* 多个并且关系的权限标识
|
||||
*/
|
||||
function foo2() {
|
||||
return <Auth auth={['permissions:name1', 'permissions:name2']}>
|
||||
<a>连接</a>
|
||||
</Auth>
|
||||
}
|
||||
|
||||
/**
|
||||
* 多个或者关系的权限标识
|
||||
*/
|
||||
function foo3() {
|
||||
return <Auth auth={[['permissions:name1'], ['permissions:name2']]}>
|
||||
<a>连接</a>
|
||||
</Auth>
|
||||
}
|
||||
|
||||
/**
|
||||
* 前缀简化
|
||||
*/
|
||||
function foo4() {
|
||||
return <Auth auth={{ 'permissions': ['name1', 'name2'] }}>
|
||||
<a>连接</a>
|
||||
</Auth>
|
||||
}
|
||||
|
||||
/**
|
||||
* 纯js
|
||||
*/
|
||||
const flag = auth('permissions:name') // => Boolean
|
||||
51
web-react/public/doc-code/auth/index.txt
Normal file
51
web-react/public/doc-code/auth/index.txt
Normal file
@@ -0,0 +1,51 @@
|
||||
import { Auth } from 'components'
|
||||
import auth from 'components/authorized/handler'
|
||||
|
||||
/**
|
||||
* 简单的权限标识
|
||||
*/
|
||||
function foo1() {
|
||||
return (
|
||||
<Auth auth="permissions:name">
|
||||
<a>连接</a>
|
||||
</Auth>
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 多个并且关系的权限标识
|
||||
*/
|
||||
function foo2() {
|
||||
return (
|
||||
<Auth auth={['permissions:name1', 'permissions:name2']}>
|
||||
<a>连接</a>
|
||||
</Auth>
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 多个或者关系的权限标识
|
||||
*/
|
||||
function foo3() {
|
||||
return (
|
||||
<Auth auth={[['permissions:name1'], ['permissions:name2']]}>
|
||||
<a>连接</a>
|
||||
</Auth>
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 前缀简化
|
||||
*/
|
||||
function foo4() {
|
||||
return (
|
||||
<Auth auth={{ permissions: ['name1', 'name2'] }}>
|
||||
<a>连接</a>
|
||||
</Auth>
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 纯js
|
||||
*/
|
||||
const flag = auth('permissions:name') // => Boolean
|
||||
Reference in New Issue
Block a user