|
@@ -48,6 +48,7 @@
|
|
|
const instance: any = getCurrentInstance();
|
|
|
const userStore = useUserStore();
|
|
|
const glob = useGlobSetting();
|
|
|
+ const websocketUrl = ref(glob.domainUrl + glob.apiUrl);
|
|
|
const dynamicNoticeProps = reactive({ path: '', formData: {} });
|
|
|
const [registerDetail, detailModal] = useModal();
|
|
|
const listData = ref(tabListData);
|
|
@@ -126,7 +127,7 @@
|
|
|
let wsClientId = md5(token);
|
|
|
let userId = unref(userStore.getUserInfo).id + '_' + wsClientId;
|
|
|
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
|
|
|
- let url = glob.domainUrl?.replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId;
|
|
|
+ let url = websocketUrl.value?.replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId;
|
|
|
connectWebSocket(url);
|
|
|
onWebSocket(onWebSocketMessage);
|
|
|
}
|