diff --git a/src/router.js b/src/router.js index 8418efb..9e3cc3f 100644 --- a/src/router.js +++ b/src/router.js @@ -120,6 +120,7 @@ const routes = [ const router = new VueRouter({ mode: 'history', + base: process.env.BASE_URL || '', routes, scrollBehavior() { return { x: 0, y: 0 } diff --git a/src/utils/socket.js b/src/utils/socket.js index 7f56ce6..363c087 100644 --- a/src/utils/socket.js +++ b/src/utils/socket.js @@ -33,5 +33,5 @@ class CustomSocket extends WebSocket { } } } - -export const socket = new CustomSocket((location.protocol === 'https:' ? 'wss://' : 'ws://') + location.host + '/') +const domain = process.env.WEBSOCKET_URL || location.host +export const socket = new CustomSocket((location.protocol === 'https:' ? 'wss://' : 'ws://') + domain + '/')