diff --git a/chat.py b/chat.py index 2708dfa..097810f 100644 --- a/chat.py +++ b/chat.py @@ -45,8 +45,6 @@ async def get_avatar_url(user_id): class Room(blivedm.BLiveClient): - _COMMAND_HANDLERS = blivedm.BLiveClient._COMMAND_HANDLERS.copy() - def __init__(self, room_id): super().__init__(room_id, session=_http_session) self.clients: List['ChatHandler'] = [] diff --git a/frontend/package.json b/frontend/package.json index dee02ee..3603236 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -8,7 +8,9 @@ "lint": "vue-cli-service lint" }, "dependencies": { + "axios": "^0.19.0", "core-js": "^2.6.5", + "element-ui": "^2.9.1", "vue": "^2.6.10", "vue-router": "^3.0.6" }, diff --git a/frontend/src/main.js b/frontend/src/main.js index 0621327..5a914f2 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -1,5 +1,7 @@ import Vue from 'vue' import VueRouter from 'vue-router' +import ElementUI from 'element-ui' +import 'element-ui/lib/theme-chalk/index.css' import App from './App.vue' import Home from './views/Home.vue' @@ -7,6 +9,7 @@ import Room from './views/Room' import NotFound from './views/NotFound.vue' Vue.use(VueRouter) +Vue.use(ElementUI) Vue.config.ignoredElements = [ /^yt-/ diff --git a/frontend/src/views/Home.vue b/frontend/src/views/Home.vue index 208f03d..e5f321c 100644 --- a/frontend/src/views/Home.vue +++ b/frontend/src/views/Home.vue @@ -1,8 +1,18 @@ @@ -11,13 +21,20 @@ export default { name: 'Home', data() { return { - roomId: window.localStorage.roomId || '1' + form: { + roomId: window.localStorage.roomId || 1 + } } }, methods: { - go() { - window.localStorage.roomId = this.roomId - this.$router.push({name: 'room', params: {roomId: this.roomId}}) + enter() { + this.$refs.form.validate(valid => { + if (!valid) { + return + } + window.localStorage.roomId = this.form.roomId + this.$router.push({name: 'room', params: {roomId: this.form.roomId}}) + }) } } }