mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-11-30 02:58:31 +08:00
fix(系统设置): 修复上传license后刷新左侧菜单不能及时显示的问题
--bug=1020767 --user=刘瑞斌 【系统设置】离线包安装后,上传license,系统左侧的菜单会变成空白的 https://www.tapd.cn/55049933/s/1315863
This commit is contained in:
parent
a3d1016912
commit
d4ba871b97
@ -156,10 +156,16 @@ export default {
|
||||
if (!hasLicense()) {
|
||||
return;
|
||||
}
|
||||
ModuleEvent.$on(MODULE_CHANGE, (key, status) => {
|
||||
getModuleList().then(() => {
|
||||
this.menuKey++;
|
||||
getModuleList()
|
||||
.then(response => {
|
||||
response.data.forEach(m => {
|
||||
this.modules[m.key] = m.status;
|
||||
});
|
||||
localStorage.setItem('modules', JSON.stringify(this.modules));
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
ModuleEvent.$on(MODULE_CHANGE, (key, status) => {
|
||||
this.$set(this.modules, key, status);
|
||||
this.menuKey++;
|
||||
});
|
||||
|
@ -63,8 +63,9 @@
|
||||
|
||||
<script>
|
||||
import MsValidLicense from "./ValidLicense";
|
||||
import {hasPermission} from "metersphere-frontend/src/utils/permission";
|
||||
import {getLicense, saveLicense} from "../../../api/license";
|
||||
import {hasPermission, saveLicense, hasLicense} from "metersphere-frontend/src/utils/permission";
|
||||
import {getLicense} from "../../../api/license";
|
||||
import {getModuleList} from "metersphere-frontend/src/api/module";
|
||||
|
||||
export default {
|
||||
name: "MxLicense",
|
||||
@ -108,7 +109,17 @@ export default {
|
||||
this.license.licenseCount = value.license.licenseCount;
|
||||
this.license.status = value.status;
|
||||
saveLicense(value.status);
|
||||
window.location.reload();
|
||||
if (hasLicense()) {
|
||||
getModuleList()
|
||||
.then(response => {
|
||||
let modules = {};
|
||||
response.data.forEach(m => {
|
||||
modules[m.key] = m.status;
|
||||
});
|
||||
localStorage.setItem('modules', JSON.stringify(modules));
|
||||
location.reload();
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user