mirror of
https://gitee.com/log4j/pig-ui.git
synced 2024-12-23 05:40:20 +08:00
ref: 优化websocket 链接
This commit is contained in:
parent
f0b0347769
commit
ade034e96d
@ -51,9 +51,9 @@
|
||||
import { useMessage } from '/@/hooks/message';
|
||||
import other from '/@/utils/other';
|
||||
import { Session } from '/@/utils/storage';
|
||||
import {useI18n} from 'vue-i18n';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
const {t} = useI18n()
|
||||
const { t } = useI18n();
|
||||
|
||||
const emit = defineEmits(['sizeChange', 'refreshDataList']);
|
||||
const prop = defineProps({
|
||||
@ -123,10 +123,9 @@ const show = () => {
|
||||
};
|
||||
|
||||
const headers = computed(() => {
|
||||
const tenantId = Session.getTenant();
|
||||
return {
|
||||
Authorization: 'Bearer ' + Session.getToken(),
|
||||
'TENANT-ID': tenantId,
|
||||
'TENANT-ID': Session.getTenant(),
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -47,7 +47,7 @@ onUnmounted(() => {
|
||||
const initWebSocket = () => {
|
||||
// ws地址
|
||||
let host = window.location.host;
|
||||
let wsUri = `ws://${host}${props.uri}?access_token=${token.value}&TENANT-ID=${tenant}`;
|
||||
let wsUri = `ws://${host}${props.uri}?access_token=${token.value}&TENANT-ID=${tenant.value}`;
|
||||
// 建立连接
|
||||
state.webSocket = new WebSocket(wsUri);
|
||||
// 连接成功
|
||||
|
Loading…
Reference in New Issue
Block a user