Kaynağa Gözat

更新 live 和 record 的路由

reghao 2 yıl önce
ebeveyn
işleme
50937d5e8c

+ 2 - 2
src/router/index.js

@@ -335,13 +335,13 @@ const routes = [
     meta: { needAuth: true }
   },
   {
-    path: '/my/cam/live/:camId',
+    path: '/my/cam/:camId/live',
     name: 'LivePage',
     component: LivePage,
     meta: { needAuth: true }
   },
   {
-    path: '/my/cam/record/:camId',
+    path: '/my/cam/:camId/record',
     name: 'RecordPage',
     component: RecordPage,
     meta: { needAuth: true }

+ 2 - 2
src/views/cam/LivePage.vue

@@ -39,7 +39,7 @@
               <div id="dplayer" ref="dplayer" style="height: 480px;" />
             </div>
             <div v-else>
-              <h5>摄像头离线, 你可以查看本摄像头的<router-link style="text-decoration-line: none; color: red" target="_blank" :to="`/my/cam/record/` + camDetail.camId">历史录像</router-link></h5>
+              <h5>摄像头离线, 你可以查看本摄像头的<router-link style="text-decoration-line: none; color: red" target="_blank" :to="`/my/cam/${camDetail.camId}/record/`">历史录像</router-link></h5>
             </div>
           </el-card>
         </el-row>
@@ -160,7 +160,7 @@ export default {
       })
     },
     goToCamRecord() {
-      const path = '/my/cam/record/' + this.camDetail.camId
+      const path = '/my/cam/' + this.camDetail.camId + '/record'
       if (this.$route.path === path) {
         this.$router.go(0)
         return

+ 1 - 1
src/views/cam/RecordPage.vue

@@ -288,7 +288,7 @@ export default {
       })
     },
     goToCamLive() {
-      const path = '/my/cam/live/' + this.camDetail.camId
+      const path = '/my/cam/' + this.camDetail.camId + '/live'
       if (this.$route.path === path) {
         this.$router.go(0)
         return

+ 1 - 1
src/views/post/CamList.vue

@@ -26,7 +26,7 @@
           width="150"
         >
           <template slot-scope="scope">
-            <router-link style="text-decoration-line: none" target="_blank" :to="`/my/cam/live/${scope.row.camId}`">
+            <router-link style="text-decoration-line: none" target="_blank" :to="`/my/cam/${scope.row.camId}/live`">
               {{ scope.row.camName }}
             </router-link>
           </template>