哟花socket.js
This commit is contained in:
parent
198f8fdf39
commit
00dac0808e
@ -1,12 +1,12 @@
|
|||||||
import { io } from 'socket.io-client'
|
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 { getCachedListResource } from 'jingrow-ui/src/resources/listResource'
|
||||||
import { getCachedResource } from 'jingrow-ui/src/resources/resources'
|
import { getCachedResource } from 'jingrow-ui/src/resources/resources'
|
||||||
|
|
||||||
export function initSocket() {
|
export function initSocket() {
|
||||||
let host = window.location.hostname
|
let host = window.location.hostname
|
||||||
let siteName = window.site_name
|
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 protocol = port ? 'http' : 'https'
|
||||||
let url = `${protocol}://${host}${port}/${siteName}`
|
let url = `${protocol}://${host}${port}/${siteName}`
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user