4.6.201909261437 • Published 5 years ago
@dfeidao/fd-am000021 v4.6.201909261437
检查当前登录用户页面权限
Installation
yarn add --dev @dfeidao/fd-am000021
Description
检查当前用户是否可访问当前页面。
如果当前用户没有访问权限,可以将其导向登陆页面,或者在渲染“没有权限查看/访问”之类的内容。
Example
import am00 from '@dfeidao/atom-mobile/interfaces';
import am21 from '@dfeidao/fd-am000021';
export default async function a001(fd: am00) {
const has_right = await am21(fd, 'web_test');
if (has_right) {
// todo
// use could access this page.
// do the normal logic here
} else {
// todo
// maybe we should exit app, or direct to login page, or just render 'You have not got right to access this page, Please contact administrator.'
}
}
4.6.201909261437
5 years ago
4.6.201909191740
5 years ago
4.6.201909161530
5 years ago
4.6.201908220950
5 years ago
4.6.201908220949
5 years ago
4.6.201907171741
5 years ago
4.6.201907171706
5 years ago