@dfeidao/atom-wxapp > auth用户权限相关
External module: auth用户权限相关
Index
Functions
Functions
check
▸ check(productid: string
, page: string
, cacha: boolean
): Promise
<object
>
Defined in authorization/check.ts:18
验证当前登录用户页面权限
example:
import check from '@dfeidao/atom-wxapp/authorization/check';
const res = check('web_test', fd.data.page.route, false);
Parameters:
Name | Type | Description |
---|---|---|
productid | string |
项目productid |
page | string |
当期页面地址,使用fd.data.page.route |
cacha | boolean |
是否使用缓存 |
Returns: Promise
<object
>
get_current_role_info
▸ get_current_role_info(productid: string
, cacha: boolean
): Promise
<object
>
Defined in authorization/get-current-role-info.ts:17
获取当前用户当前角色信息
example:
import get_current_role_info from '@dfeidao/atom-wxapp/authorization/get-current-role-info';
const res = get_current_role_info('web_test', false);
Parameters:
Name | Type | Description |
---|---|---|
productid | string |
项目productid |
cacha | boolean |
是否使用缓存 |
Returns: Promise
<object
>
get_menus
▸ get_menus(productid: string
, cacha: boolean
): Promise
<IMenu
[]>
Defined in authorization/get-menus.ts:18
获取当前用户的权限菜单
example:
import get_menus from '@dfeidao/atom-wxapp/authorization/get-menus';
const res = get_menus('web_test', false);
Parameters:
Name | Type | Description |
---|---|---|
productid | string |
项目productid |
cacha | boolean |
是否使用缓存 |
Returns: Promise
<IMenu
[]>
get_params
▸ get_params(productid: string
, cacha: boolean
): Promise
<any
>
Defined in authorization/get-params.ts:17
获取params
example:
import get_params from '@dfeidao/atom-wxapp/authorization/get-params';
const res = get_params('web_test', false);
Parameters:
Name | Type | Description |
---|---|---|
productid | string |
项目productid |
cacha | boolean |
是否使用缓存 |
Returns: Promise
<any
>
get_roles
▸ get_roles(productid: string
, cacha: boolean
): Promise
<IRole
[]>
Defined in authorization/get-roles.ts:17
获取当前用户除去当前角色之外的其他角色
example:
import get_roles from '@dfeidao/atom-wxapp/authorization/get-roles';
const res = get_roles('web_test', false);
Parameters:
Name | Type | Description |
---|---|---|
productid | string |
项目productid |
cacha | boolean |
是否使用缓存 |
Returns: Promise
<IRole
[]>
set_user_role
▸ set_user_role(productid: string
, role_no: string
, cacha: boolean
): Promise
<object
>
Defined in authorization/set-user-role.ts:19
设置当前用户的角色
see: 微信官方文档
example:
import set_user_role from '@dfeidao/atom-wxapp/authorization/set-user-role';
const res = set_user_role('web_test', 'role_no', false);
Parameters:
Name | Type | Description |
---|---|---|
productid | string |
项目productid |
role_no | string |
角色编号 |
cacha | boolean |
是否使用缓存 |
Returns: Promise
<object
>