Skip to content

Commit 889346a

Browse files
committed
fix: 🐛 ts 类型警告问题修复
1 parent a656a40 commit 889346a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/composables/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export { useStomp } from "./websocket/useStomp";
2-
export { useDictSync, DictMessage } from "./websocket/useDictSync";
2+
export { useDictSync } from "./websocket/useDictSync";
3+
export type { DictMessage } from "./websocket/useDictSync";
34
export { useOnlineCount } from "./websocket/useOnlineCount";
45

56
export { useLayout } from "./layout/useLayout";

src/composables/websocket/useDictSync.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function createDictSyncHook() {
8989
}
9090

9191
// 取消所有订阅
92-
subscriptionIds.value.forEach((id) => {
92+
subscriptionIds.value.forEach((id: string) => {
9393
unsubscribe(id);
9494
});
9595
subscriptionIds.value = [];
@@ -182,7 +182,7 @@ function createDictSyncHook() {
182182
console.log(`[DictSync] 字典缓存已清除: ${dictCode}`);
183183

184184
// 调用所有注册的回调函数
185-
messageCallbacks.value.forEach((callback) => {
185+
messageCallbacks.value.forEach((callback: DictMessageCallback) => {
186186
try {
187187
callback(parsedData);
188188
} catch (callbackError) {

0 commit comments

Comments
 (0)