优化文件结构

This commit is contained in:
John Smith
2019-06-09 12:37:59 +08:00
parent 82bfb69a0a
commit 8dbba50548
9 changed files with 12 additions and 8 deletions

Submodule blivedm updated: fe5b4ca2c9...39fb86a9b2

View File

View File

@@ -2,12 +2,16 @@ import Vue from 'vue'
import VueRouter from 'vue-router'
import App from './App.vue'
import Home from './components/Home.vue'
import Room from './components/Room.vue'
import NotFound from './components/NotFound.vue'
import Home from './views/Home.vue'
import Room from './views/Room'
import NotFound from './views/NotFound.vue'
Vue.use(VueRouter)
Vue.config.ignoredElements = [
/^yt-/
]
const router = new VueRouter({
mode: 'history',
routes: [

View File

@@ -57,9 +57,9 @@ export default {
}
},
created() {
this.websocket = new WebSocket(`ws://${window.location.host}/chat`)
//
// this.websocket = new WebSocket('ws://localhost/chat')
// 使localhost:80
const url = process.env.NODE_ENV === 'development' ? 'ws://localhost/chat' : `ws://${window.location.host}/chat`
this.websocket = new WebSocket(url)
this.websocket.onopen = () => this.websocket.send(JSON.stringify({
cmd: COMMAND_JOIN_ROOM,
data: {
@@ -122,4 +122,4 @@ export default {
}
</script>
<style src="../assets/room.css"></style>
<style src="../../assets/room.css"></style>