refactor(web-antd): 用 SSE 替代 WebSocket 实现通知和电表数据实时推送
This commit is contained in:
@@ -16,8 +16,6 @@ import { $t } from '#/locales'
|
||||
|
||||
import { useDictStore } from './dict'
|
||||
|
||||
import { initWebSocket, getWebSocketService } from '#/api/websocket'
|
||||
|
||||
export const useAuthStore = defineStore('auth', () => {
|
||||
const accessStore = useAccessStore()
|
||||
const userStore = useUserStore()
|
||||
@@ -81,13 +79,6 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
try {
|
||||
await seeConnectionClose()
|
||||
await doLogout()
|
||||
/**
|
||||
* 断开websocket连接
|
||||
*/
|
||||
const ws = getWebSocketService();
|
||||
if(ws) {
|
||||
ws.close();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
@@ -128,11 +119,6 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
}
|
||||
userStore.setUserInfo(userInfo)
|
||||
|
||||
/**
|
||||
* 初始化websocket
|
||||
*/
|
||||
initWebSocket()
|
||||
|
||||
/**
|
||||
* 需要重新加载字典
|
||||
* 比如退出登录切换到其他租户
|
||||
|
Reference in New Issue
Block a user