|
|
@@ -58,6 +58,7 @@
|
|
|
import { usePermissionStore } from '/@/store/modules/permission';
|
|
|
import SpeakVoice from './notify/speakVoice';
|
|
|
import { useDrag } from '@/hooks/event/useDrag';
|
|
|
+ import { useGlobSetting } from '/@/hooks/setting';
|
|
|
import dayjs from 'dayjs';
|
|
|
export default defineComponent({
|
|
|
name: 'VoiceBroadcast',
|
|
|
@@ -70,6 +71,7 @@
|
|
|
const { hasPermission } = usePermission();
|
|
|
const permissionStore = usePermissionStore();
|
|
|
const router = useRouter();
|
|
|
+ const glob = useGlobSetting();
|
|
|
const list = (params) => defHttp.get({ url: '/safety/ventanalyAlarmLog/list', params });
|
|
|
const cleanAlarm = () => defHttp.get({ url: '/safety/ventanalyAlarmLog/cleanAlarmLog' });
|
|
|
const activeKey = ref(0);
|
|
|
@@ -130,8 +132,8 @@
|
|
|
let userId = unref(userStore.getUserInfo).id + '?token=' + token;
|
|
|
console.log(userStore.getUserInfo, 'userId---');
|
|
|
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
|
|
|
- // let url = glob.wsUrl?.replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId;
|
|
|
- let url = 'http://' + window.location.hostname + ':9999'?.replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId;
|
|
|
+ // [SEC-20260913] 端点改读运行时配置 glob.wsUrl(public/js/config.js 单点),去掉 :9999 硬编码
|
|
|
+ let url = glob.wsUrl?.replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId;
|
|
|
console.log(url, 'url------');
|
|
|
connectWebSocket(url);
|
|
|
onWebSocket(onWebSocketMessage);
|