From ebee36ca9a39b59d98da3613804791faa8dd2da6 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期六, 22 十一月 2025 16:20:52 +0800
Subject: [PATCH] 打印完善
---
src/store/modules/user.ts | 54 ++----------------------------------------------------
1 files changed, 2 insertions(+), 52 deletions(-)
diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts
index 2d5600b..379eb10 100644
--- a/src/store/modules/user.ts
+++ b/src/store/modules/user.ts
@@ -3,11 +3,10 @@
import { getAccessToken, removeToken } from '@/utils/auth'
import { CACHE_KEY, useCache, deleteUserCache } from '@/hooks/web/useCache'
import { getInfo, loginOut } from '@/api/login'
-import {RoomVO} from "@/api/ecg/room";
const { wsCache } = useCache()
-interface UserVO {
+export interface UserVO {
id: number
avatar: string
nickname: string
@@ -20,10 +19,6 @@
roles: string[]
isSetUser: boolean
user: UserVO
-
- // 鍖荤敓璇婂閫夋嫨
- isSetRoom: boolean
- room: RoomVO
}
export const useUserStore = defineStore('admin-user', {
@@ -35,17 +30,8 @@
id: 0,
avatar: '',
nickname: '',
- deptId: 0
+ deptId: 0,
},
- // 鍖荤敓璇婂閫夋嫨
- isSetRoom: false,
- room: {
- id: 0,
- roomId: 0,
- roomName: "",
- bedNo: "",
- onstage: true
- }
}),
getters: {
getPermissions(): string[] {
@@ -60,13 +46,6 @@
getUser(): UserVO {
return this.user
},
- // 鍖荤敓璇婂閫夋嫨
- getIsSetRoom(): boolean {
- return this.isSetRoom
- },
- getRoom(): RoomVO {
- return this.room
- }
},
actions: {
async setUserInfoAction() {
@@ -85,26 +64,6 @@
wsCache.set(CACHE_KEY.USER, userInfo)
wsCache.set(CACHE_KEY.ROLE_ROUTERS, userInfo.menus)
},
- // 鍖荤敓璇婂閫夋嫨
- async setRoomInfoAction(room: RoomVO) {
- if (!getAccessToken()) {
- this.resetState()
- return null
- }
-
- // 鏇存柊 store
- this.room = room
- this.isSetRoom = true
-
- // 鏇存柊 cache
- const userInfo2 = wsCache.get(CACHE_KEY.USER)
- if (userInfo2) {
- userInfo2.room = room
- userInfo2.isSetRoom = true
- wsCache.set(CACHE_KEY.USER, userInfo2)
- }
- },
-
async setUserAvatarAction(avatar: string) {
const userInfo = wsCache.get(CACHE_KEY.USER)
// NOTE: 鏄惁闇�瑕佸儚`setUserInfoAction`涓�鏍峰垽鏂璥userInfo != null`
@@ -134,15 +93,6 @@
avatar: '',
nickname: '',
deptId: 0
- }
- // 鍖荤敓璇婂閫夋嫨
- this.isSetRoom = false
- this.room = {
- id: 0,
- roomId: 0,
- roomName: "",
- bedNo: "",
- onstage: true
}
}
}
--
Gitblit v1.9.3