4.1 同步发版内容到天梯

This commit is contained in:
jl-zhoujl2
2022-04-01 20:06:34 +08:00
parent a3b939d154
commit 7b3efe00dd
128 changed files with 929 additions and 5029 deletions

View File

@ -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(显示)