|
@@ -4,6 +4,7 @@ import {
|
|
|
UseWebSocketReturn,
|
|
|
} from "@vueuse/core";
|
|
|
import { useUserStore } from "@/pinia/user-store";
|
|
|
+import { xcMessage } from "@/utils/xiaochan-element-plus";
|
|
|
|
|
|
export type UsCyeWebSocketOptions = UseWebSocketOptions & {
|
|
|
socketMsg?: {
|
|
@@ -47,6 +48,15 @@ export function useCySocket(url: any, options?: UsCyeWebSocketOptions) {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
+ const oldConnected = val.onConnected;
|
|
|
+
|
|
|
+ val.onConnected = ws => {
|
|
|
+ if (setInfo && socket.status.value === "OPEN") {
|
|
|
+ socket.send(getUserInfo());
|
|
|
+ }
|
|
|
+ oldConnected?.(ws);
|
|
|
+ };
|
|
|
+
|
|
|
const oldOnMessage = val.onMessage;
|
|
|
|
|
|
val.onMessage = (ws, event) => {
|