diff --git a/src/layout/index.vue b/src/layout/index.vue index 512fac59..8412aa25 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -103,7 +103,8 @@ export default { sidebar: state => state.app.sidebar, device: state => state.app.device, needTagsView: state => state.settings.tagsView, - fixedHeader: state => state.settings.fixedHeader + fixedHeader: state => state.settings.fixedHeader, + roles: state => state.user.roles, }), classObj() { return { @@ -119,7 +120,9 @@ export default { }, created() { this.checkPasswordStatus() - this.connectWebSocket(); + if (this.roles.includes("audit") || this.roles.includes("systemAdmin")) { + this.connectWebSocket(); + } }, methods: { checkPasswordStatus() {