From c980edafe5bf00f9cfe5d999896bb3bb971c8943 Mon Sep 17 00:00:00 2001
From: zhangchen <1652267879@qq.com>
Date: 星期三, 10 九月 2025 19:49:28 +0800
Subject: [PATCH] ID1766-暂存

---
 src/views/mobile/bedsideAuxiliaryScreen/components/Login/index.vue |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/views/mobile/bedsideAuxiliaryScreen/components/Login/index.vue b/src/views/mobile/bedsideAuxiliaryScreen/components/Login/index.vue
index 767da55..27dc92f 100644
--- a/src/views/mobile/bedsideAuxiliaryScreen/components/Login/index.vue
+++ b/src/views/mobile/bedsideAuxiliaryScreen/components/Login/index.vue
@@ -59,7 +59,7 @@
     });
 
     const isLoginng = computed(() => {
-      return !!bedsideAuxiliaryScreenStore.userInfo.code;
+      return !!bedsideAuxiliaryScreenStore.userInfo?.code;
     });
 
     const qrCodeData = computed(() => {
@@ -78,13 +78,23 @@
     };
 
     const onLogout = () => {
+      if (state.loading) return ElMessage.warning('正在退出中...')
       ElMessageBox.confirm("是否确认退出当前登录用户?", "提示", {
         confirmButtonText: "确认",
         cancelButtonText: "取消",
         type: "warning",
       })
-        .then(() => {
-            bedsideAuxiliaryScreenStore.logout();
+        .then(async() => {
+            state.loading = true
+            try {
+              await bedsideAuxiliaryScreenStore.logout(bedsideAuxiliaryScreenStore.deviceCode);
+              handleCancel();
+              ElMessage.success('退出登录成功')
+            } catch (error) {
+              ElMessage.success('退出登录失败')
+            } finally {
+              state.loading = false;
+            }
           ElMessage({
             type: "success",
             message: "退出成功!",

--
Gitblit v1.8.0