This commit is contained in:
liqiang-fit2cloud 2023-01-06 14:45:29 +08:00
commit bbf9f27809
4 changed files with 18 additions and 26 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

@ -146,16 +146,9 @@ export default {
},
check(key) {
let microApps = JSON.parse(sessionStorage.getItem("micro_apps"));
if (hasLicense()) {
return this.modules[key] === 'ENABLE' && microApps[key];
}
return microApps && microApps[key];
return this.modules[key] === 'ENABLE' && microApps && microApps[key];
},
registerEvents() {
if (!hasLicense()) {
return;
}
getModuleList()
.then(response => {
response.data.forEach(m => {

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() {