1
0
forked from test/crm

哟花socket.js

This commit is contained in:
jingrow 2025-10-23 23:41:02 +08:00
parent 198f8fdf39
commit 00dac0808e

View File

@ -1,12 +1,12 @@
import { io } from 'socket.io-client'
import { socketio_port } from '../../../../sites/common_site_config.json'
import config from '../../../../sites/common_site_config.json'
import { getCachedListResource } from 'jingrow-ui/src/resources/listResource'
import { getCachedResource } from 'jingrow-ui/src/resources/resources'
export function initSocket() {
let host = window.location.hostname
let siteName = window.site_name
let port = window.location.port ? `:${socketio_port}` : ''
let port = window.location.port ? `:${config.socketio_port}` : ''
let protocol = port ? 'http' : 'https'
let url = `${protocol}://${host}${port}/${siteName}`