| | |
| | | |
| | | const { wsCache } = useCache() |
| | | |
| | | interface UserVO { |
| | | export interface UserVO { |
| | | id: number |
| | | avatar: string |
| | | nickname: string |
| | |
| | | id: 0, |
| | | avatar: '', |
| | | nickname: '', |
| | | deptId: 0 |
| | | } |
| | | deptId: 0, |
| | | }, |
| | | }), |
| | | getters: { |
| | | getPermissions(): string[] { |
| | |
| | | }, |
| | | getUser(): UserVO { |
| | | return this.user |
| | | } |
| | | }, |
| | | }, |
| | | actions: { |
| | | async setUserInfoAction() { |
| | |
| | | wsCache.set(CACHE_KEY.USER, userInfo) |
| | | }, |
| | | async loginOut() { |
| | | // 【本需求·选 B】退出登录**不再释放工位**。 |
| | | // |
| | | // 为什么: |
| | | // ① 一人多工位后,同一医生可能同时在多台电脑上各操作一个岗位 —— |
| | | // 其中一台退出登录若按 userId 释放"全部工位",会把另一台正在用的岗位也清掉; |
| | | // ② 工位释放改为三种明确途径:医生点「离座」;闭诊统一清空; |
| | | // 管理员「清空工位」/ 接班医生「接管」(`POST /clinic/room/take-over-bed`)。 |
| | | // 原先这里调用 `releaseBedOnExit('manual-logout')` → `/ecg/doctor/release-my-beds`。 |
| | | await loginOut() |
| | | removeToken() |
| | | deleteUserCache() // 删除用户缓存 |