From 5e2a9dd00eddfcab0068c1aaa31cda5af7fdc277 Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Fri, 10 May 2024 17:32:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=B7=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/index.vue | 5 ++++- src/store/modules/app.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/layout/index.vue b/src/layout/index.vue index e2fe03f..d2a4861 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -34,7 +34,7 @@ 个人信息 - + 退出 @@ -147,6 +147,9 @@ export default { }, methods: { async logout() { + if (this.$store.state.app.isInElectron) { + return + } await this.$store.dispatch('app/clearLayout') await this.$store.dispatch("user/logout"); this.$router.push(`/login`); diff --git a/src/store/modules/app.js b/src/store/modules/app.js index 39327f0..43cefb0 100644 --- a/src/store/modules/app.js +++ b/src/store/modules/app.js @@ -11,6 +11,7 @@ const state = { }, device: "desktop", workerLayout: {}, + isInElectron: window.process?.versions?.hasOwnProperty("electron"), isInIframe: false, }; const getter = {