add room vue router
backend-api
Mustafa Yontar 5 years ago
parent 9baa128cad
commit 71e39389b8
  1. 11
      package-lock.json
  2. 2
      package.json
  3. 2
      src/main.js
  4. 7
      src/router/index.js
  5. 16
      src/store/index.js
  6. 3
      src/views/Home.vue
  7. 13
      src/views/Room.vue

11
package-lock.json generated

@ -1311,9 +1311,9 @@
} }
}, },
"@vue/cli-plugin-vuex": { "@vue/cli-plugin-vuex": {
"version": "4.2.3", "version": "4.3.1",
"resolved": "https://registry.npmjs.org/@vue/cli-plugin-vuex/-/cli-plugin-vuex-4.2.3.tgz", "resolved": "https://registry.npm.taobao.org/@vue/cli-plugin-vuex/download/@vue/cli-plugin-vuex-4.3.1.tgz",
"integrity": "sha512-7M4CaoAD4W/GdiDI4+Gh2tATPFBnb/u7bCiLLDsuL9ztypv7l3p4cu43zkDpTCCuufkZFYtZwysOAY8SbGqOjg==", "integrity": "sha1-K3Ov9W+eG+MQGIc9XtLVnxVedHY=",
"dev": true "dev": true
}, },
"@vue/cli-service": { "@vue/cli-service": {
@ -11372,6 +11372,11 @@
"loader-utils": "^1.2.0" "loader-utils": "^1.2.0"
} }
}, },
"vuex": {
"version": "3.1.3",
"resolved": "https://registry.npm.taobao.org/vuex/download/vuex-3.1.3.tgz?cache=0&sync_timestamp=1584268708627&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvuex%2Fdownload%2Fvuex-3.1.3.tgz",
"integrity": "sha1-8q1z4/tzaRaYs4yT9m5Y4meUcYA="
},
"watchpack": { "watchpack": {
"version": "1.6.0", "version": "1.6.0",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz",

@ -14,12 +14,14 @@
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-router": "^3.1.6", "vue-router": "^3.1.6",
"vuetify": "^2.2.11", "vuetify": "^2.2.11",
"vuex": "^3.1.3",
"webrtc-adapter": "^7.5.1" "webrtc-adapter": "^7.5.1"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "~4.2.0", "@vue/cli-plugin-babel": "~4.2.0",
"@vue/cli-plugin-eslint": "~4.2.0", "@vue/cli-plugin-eslint": "~4.2.0",
"@vue/cli-plugin-router": "^4.3.1", "@vue/cli-plugin-router": "^4.3.1",
"@vue/cli-plugin-vuex": "^4.3.1",
"@vue/cli-service": "~4.2.0", "@vue/cli-service": "~4.2.0",
"axios": "^0.18.0", "axios": "^0.18.0",
"babel-eslint": "^10.0.3", "babel-eslint": "^10.0.3",

@ -4,6 +4,7 @@ import JanusPlugin from "@/plugins/janus"
import App from './App.vue' import App from './App.vue'
import vuetify from './plugins/vuetify'; import vuetify from './plugins/vuetify';
import router from './router' import router from './router'
import store from './store'
Vue.config.productionTip = false Vue.config.productionTip = false
@ -11,5 +12,6 @@ new Vue({
vuetify, vuetify,
JanusPlugin, JanusPlugin,
router, router,
store,
render: h => h(App) render: h => h(App)
}).$mount('#app') }).$mount('#app')

@ -8,7 +8,12 @@ Vue.use(VueRouter)
path: '/', path: '/',
name: 'Home', name: 'Home',
component: () => import(/* webpackChunkName: "about" */ '../views/Home.vue') component: () => import(/* webpackChunkName: "about" */ '../views/Home.vue')
} },
{
path: '/rooms',
name: 'Room',
component: () => import(/* webpackChunkName: "about" */ '../views/Room.vue')
}
] ]
const router = new VueRouter({ const router = new VueRouter({

@ -0,0 +1,16 @@
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
token: null
},
mutations: {
},
actions: {
},
modules: {
}
})

@ -33,6 +33,9 @@ export default {
this.$axios.post('login', { this.$axios.post('login', {
username: this.code, username: this.code,
password: this.password password: this.password
}).then(response => {
this.$store.state.token = response.data.access_token
this.$router.push('/rooms')
}) })
} }
} }

@ -0,0 +1,13 @@
<template>
<div>room</div>
</template>
<script>
export default {
name: "Room"
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save