fix(接口测试): 修复场景列表不显示创建性能测试按钮的缺陷

--bug=1032161 --user=王孝刚 【接口测试】接口自动化-接口场景创建性能测试按钮不显示
https://www.tapd.cn/55049933/s/1428483
This commit is contained in:
wxg0103 2023-10-19 14:57:09 +08:00 committed by wxg0103
parent 9a2ab6208b
commit dd2054dc6f
1 changed files with 7 additions and 5 deletions

View File

@ -1,18 +1,20 @@
function enableModules(...modules) {
let sysModules = JSON.parse(sessionStorage.getItem("modules"));
let projectModules = JSON.parse(sessionStorage.getItem("project_modules"));
let workModules = JSON.parse(sessionStorage.getItem("workspace_modules"));
for (let module of modules) {
let modules = JSON.parse(localStorage.getItem("modules"));
if (module === "project" || module === "setting") {
return modules && modules[module] === "ENABLE";
}
let projectModules = JSON.parse(sessionStorage.getItem("project_modules"));
if (projectModules && projectModules.length > 0) {
return (
modules[module] === "ENABLE" && projectModules.indexOf(modules) > -1
sysModules[module] === "ENABLE" && projectModules.indexOf(module) > -1
);
}
let workModules = JSON.parse(sessionStorage.getItem("workspace_modules"));
if (workModules && workModules.length > 0) {
return modules[module] === "ENABLE" && workModules.indexOf(modules) > -1;
return (
sysModules[module] === "ENABLE" && workModules.indexOf(module) > -1
);
}
if (modules && modules[module] === "DISABLE") {
return false;