From 49206ee0689d44367b9f5de3decf0c3ec02bfb51 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期二, 15 四月 2025 10:56:18 +0800
Subject: [PATCH] update

---
 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