From 80878eaf15525329cddc3b06659a798b812af7dc Mon Sep 17 00:00:00 2001
From: zhangchen <1652267879@qq.com>
Date: 星期五, 12 九月 2025 15:05:45 +0800
Subject: [PATCH] ID1766-用户默认头像修改
---
src/views/mobile/bedsideAuxiliaryScreen/components/Login/index.vue | 28 +++++++++++++++++++++++++---
1 files changed, 25 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..fe56ba9 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(() => {
@@ -67,6 +67,16 @@
deviceCode: bedsideAuxiliaryScreenStore.deviceCode,
deviceNo: bedsideAuxiliaryScreenStore.deviceData.devicdeNo,
};
+ });
+
+ const userInfo = computed(() => {
+ const userInfo = bedsideAuxiliaryScreenStore.userInfo;
+ if (!userInfo) return null;
+ return {
+ ...userInfo,
+ 床号: bedsideAuxiliaryScreenStore.deviceData.devicdeNo,
+ 设备编号: bedsideAuxiliaryScreenStore.deviceCode
+ }
});
const openDialog = () => {
@@ -78,13 +88,24 @@
};
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('退出登录成功')
+ handleCancel();
+ } catch (error) {
+ ElMessage.success('退出登录失败')
+ } finally {
+ state.loading = false;
+ }
ElMessage({
type: "success",
message: "退出成功!",
@@ -101,6 +122,7 @@
handleCancel,
openDialog,
onLogout,
+ userInfo,
};
},
};
--
Gitblit v1.8.0