Custom serverRoot fix

This commit is contained in:
Sam 2018-07-20 22:07:34 +10:00
parent 86c60e501f
commit 31468b414c
3 changed files with 8 additions and 12 deletions

View File

@ -2,8 +2,8 @@
"webroot": "", "webroot": "",
"serverroot": "", "serverroot": "",
"accessUrl": "", "accessUrl": "",
"autoJoin": false, "autoJoin": true,
"autoJoinServer": "", "autoJoinServer": "https://v2au1.synclounge.tv",
"autoJoinRoom": "", "autoJoinRoom": "acwacdwacdwawd",
"autoJoinPassword": "" "autoJoinPassword": ""
} }

View File

@ -196,8 +196,8 @@ export default {
console.log('Login failed', e) console.log('Login failed', e)
return this.$router.push('/signin') return this.$router.push('/signin')
} }
console.log('Settings', settings)
if (settings.autoJoin) { if (settings.autoJoin) {
console.log('Autojoining...')
await this.$store.dispatch('autoJoin', { await this.$store.dispatch('autoJoin', {
server: settings.autoJoinServer, server: settings.autoJoinServer,
password: settings.autoJoinPassword, password: settings.autoJoinPassword,

View File

@ -117,17 +117,13 @@ export default {
state._socket.disconnect() state._socket.disconnect()
} }
console.log('Socket attempt connect on ' + address) console.log('Socket attempt connect on ' + address)
const getLocation = (href) => { let path = address.split('/')[3] || ''
var l = document.createElement('a') address = address.replace(path, '')
l.href = href console.log('Pathname', path)
return l
}
let addr = getLocation(address)
console.debug(addr.pathname)
state._socket = state._io.connect(address, { state._socket = state._io.connect(address, {
'forceNew': true, 'forceNew': true,
'connect timeout': 7000, 'connect timeout': 7000,
path: addr.pathname + '/socket.io' path: '/' + path + '/socket.io'
}) })
state._socket.on('connect', function (result) { state._socket.on('connect', function (result) {
// Good connection // Good connection