index.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import Vue from 'vue'
  2. import VueRouter from 'vue-router'
  3. import control from '../components/control.vue'
  4. import videoList from '../components/videoList.vue'
  5. import channelList from '../components/channelList.vue'
  6. import devicePosition from '../components/devicePosition.vue'
  7. import login from '../components/Login.vue'
  8. import parentPlatformList from '../components/ParentPlatformList.vue'
  9. const originalPush = VueRouter.prototype.push
  10. VueRouter.prototype.push = function push(location) {
  11. return originalPush.call(this, location).catch(err => err)
  12. }
  13. Vue.use(VueRouter)
  14. export default new VueRouter({
  15. mode:'hash',
  16. routes: [
  17. {
  18. path: '/',
  19. component: control,
  20. },
  21. {
  22. path: '/videoList',
  23. component: videoList,
  24. },
  25. {
  26. path: '/login',
  27. name: '登录',
  28. component: login,
  29. },
  30. {
  31. path: '/channelList/:deviceId/:parentChannelId/:count/:page',
  32. name: 'channelList',
  33. component: channelList,
  34. },
  35. {
  36. path: '/parentPlatformList/:count/:page',
  37. name: 'parentPlatformList',
  38. component: parentPlatformList,
  39. },
  40. {
  41. path: '/devicePosition/:deviceId/:parentChannelId/:count/:page',
  42. name: 'devicePosition',
  43. component: devicePosition,
  44. },
  45. ]
  46. })