From ae4a12098792b1a0189616b1563651e454e40008 Mon Sep 17 00:00:00 2001 From: jiang Date: Mon, 11 Nov 2024 13:42:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=99=BB=E5=BD=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/index.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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() {