mirror of
https://github.com/xfgryujk/blivechat.git
synced 2026-08-19 09:43:28 +08:00
优化文件结构
This commit is contained in:
2
blivedm
2
blivedm
Submodule blivedm updated: fe5b4ca2c9...39fb86a9b2
0
frontend/src/components/.gitkeep
Normal file
0
frontend/src/components/.gitkeep
Normal 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: [
|
||||
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user