refactor: ♻️ 通知公告、字典重构

This commit is contained in:
ray
2024-10-03 17:42:51 +08:00
parent 476f257bc1
commit 3db4b2a6e5
25 changed files with 931 additions and 669 deletions

View File

@@ -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);
});
}