refactor: ♻️ 通知公告、字典重构
This commit is contained in:
@@ -188,15 +188,13 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import WebSocketManager from "@/api/socket";
|
||||
import WebSocketManager from "@/utils/socket";
|
||||
|
||||
defineOptions({
|
||||
name: "Dashboard",
|
||||
inheritAttrs: false,
|
||||
});
|
||||
|
||||
import { Client } from "@stomp/stompjs";
|
||||
|
||||
import { useUserStore } from "@/store/modules/user";
|
||||
import { NoticeTypeEnum, getNoticeLabel } from "@/enums/NoticeTypeEnum";
|
||||
import StatsAPI, { VisitStatsVO } from "@/api/log";
|
||||
@@ -390,7 +388,7 @@ const getNoticeLevelTag = (type: number) => {
|
||||
};
|
||||
|
||||
function connectWebSocket() {
|
||||
WebSocketManager.getWebSocketClient("/topic/onlineUserCount", (message) => {
|
||||
WebSocketManager.getOrCreateClient("/topic/onlineUserCount", (message) => {
|
||||
onlineUserCount.value = JSON.parse(message);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user