refactor(系统设置): 模块管理已经开源

--task=1010909 --user=刘瑞斌 【开源计划】功能模块... https://www.tapd.cn/55049933/s/1323488
This commit is contained in:
CaptainB 2023-01-06 13:13:09 +08:00
parent 86c276db3a
commit 17aed53797
3 changed files with 17 additions and 18 deletions

View File

@ -84,6 +84,14 @@ export default {
this.headerHeight = "30px";
}
this.initSessionTimer();
getModuleList()
.then(response => {
let modules = {};
response.data.forEach(m => {
modules[m.key] = m.status;
});
localStorage.setItem('modules', JSON.stringify(modules));
});
if (!hasLicense()) {
setDefaultTheme();
setCustomizeColor();
@ -96,13 +104,6 @@ export default {
// this.$store.commit('setTheme', res.data);
});
this.getDisplayInfo();
getModuleList().then(response => {
let modules = {};
response.data.forEach(m => {
modules[m.key] = m.status;
});
localStorage.setItem('modules', JSON.stringify(modules));
});
}
this.isFixed = localStorage.getItem('app-fixed') === 'true' || false;

View File

@ -147,6 +147,14 @@ export default {
this.openLdap = response.data;
});
}
getModuleList()
.then(response => {
let modules = {};
response.data.forEach(m => {
modules[m.key] = m.status;
});
localStorage.setItem('modules', JSON.stringify(modules));
});
//
checkLicense()
.then(() => {
@ -171,13 +179,6 @@ export default {
document.title = title;
}
})
getModuleList().then(response => {
let modules = {};
response.data.forEach(m => {
modules[m.key] = m.status;
});
localStorage.setItem('modules', JSON.stringify(modules));
});
})

View File

@ -53,7 +53,6 @@
import {MODULE_CHANGE, ModuleEvent} from "metersphere-frontend/src/components/head/ListEvent";
import {hasPermission} from "metersphere-frontend/src/utils/permission";
import {getModuleList, updateStatus} from "@/api/module";
import {hasLicense} from "metersphere-frontend/src/utils/permission";
export default {
name: "MsModule",
@ -78,9 +77,7 @@ export default {
};
},
mounted() {
if (hasLicense()) {
this.list();
}
this.list();
},
computed: {
disabled() {