4.1 同步发版内容到天梯
This commit is contained in:
@ -32,15 +32,16 @@ export function getAuthority(str?: string): string | string[] {
|
||||
// reloadAuthorized();
|
||||
// }
|
||||
//全局按钮控制 登陆角色是否显示功能 不显示:return true
|
||||
export function btnAuthority(allowedRoles: string[]) {
|
||||
export function btnAuthority(allowedRoles: string[], type?: string) {
|
||||
const roles = getRA();//当前登陆账号的角色数组
|
||||
let control = true;
|
||||
|
||||
//根据session中的 采购经理是否可操作 属性,返回控制值
|
||||
if (getPurchaseCanOperate() == null) {
|
||||
if (getPurchaseCanOperate() == null && type != '1') {
|
||||
control = false;
|
||||
}
|
||||
//根据传入得可操作角色 返回控制值
|
||||
if (!control && allowedRoles?.length > 0 && roles != null) {
|
||||
if ((!control || type=='1') && allowedRoles?.length > 0 && roles != null) {
|
||||
for (let index = 0; index < allowedRoles.length; index++) {
|
||||
const element = allowedRoles[index];
|
||||
control = !roles.includes(element);//传入的角色有一个有权限就跳出,反false(显示)
|
||||
|
Reference in New Issue
Block a user