reghao 1 anno fa
parent
commit
9cd0ab8215

+ 6 - 6
src/components/layout/NavBar.vue

@@ -313,11 +313,11 @@ export default {
       this.$router.push(path)
     },
     goToPost() {
-      if (this.$route.path === '/my/post/list/video') {
+      if (this.$route.path === '/post/list/video') {
         this.$router.go(0)
         return
       }
-      this.$router.push('/my/post/list/video')
+      this.$router.push('/post/list/video')
     },
     goToFavlist() {
       if (this.$route.path === '/my/favlist/video') {
@@ -334,18 +334,18 @@ export default {
       this.$router.push('/my/visit')
     },
     goToMessage() {
-      if (this.$route.path === '/my/message/receive') {
+      if (this.$route.path === '/my/message') {
         this.$router.go(0)
         return
       }
-      this.$router.push('/my/message/receive')
+      this.$router.push('/my/message')
     },
     goToPublish() {
-      if (this.$route.path === '/my/post/publish/video') {
+      if (this.$route.path === '/post/publish/video') {
         this.$router.go(0)
         return
       }
-      this.$router.push('/my/post/publish/video')
+      this.$router.push('/post/publish/video')
     }
   }
 }

+ 1 - 1
src/components/upload/EditArticle.vue

@@ -81,7 +81,7 @@ export default {
       this.form.content = value
     },
     onReturnArticle() {
-      this.$router.push('/my/post/list/article')
+      this.$router.push('/post/list/article')
     },
     onUpdateArticleContent() {
       updateArticleContent(this.form).then(resp => {

+ 1 - 1
src/components/upload/EditAudio.vue

@@ -60,7 +60,7 @@ export default {
   },
   methods: {
     onReturnAudio() {
-      this.$router.push('/my/post/list/audio')
+      this.$router.push('/post/list/audio')
     },
     onUpdateAudioPost() {
       this.$notify({

+ 1 - 1
src/components/upload/EditImage.vue

@@ -274,7 +274,7 @@ export default {
       })
     },
     onReturnAlbum() {
-      this.$router.push('/my/post/list/image')
+      this.$router.push('/post/list/image')
     },
     onAddImages() {
       const jsonData = {}

+ 1 - 1
src/components/upload/EditVideo.vue

@@ -287,7 +287,7 @@ export default {
     },
     // ****************************************************************************************************************
     onReturnVideo() {
-      this.$router.push('/my/post/list/video')
+      this.$router.push('/post/list/video')
     },
     onUpdateVideoInfo() {
       updateVideoInfo(this.videoInfoForm).then(res => {

+ 1 - 1
src/components/upload/PublishArticle.vue

@@ -54,7 +54,7 @@ export default {
             type: 'warning',
             duration: 3000
           })
-          this.$router.push('/my/post/list/article')
+          this.$router.push('/post/list/article')
         } else {
           this.$notify({
             title: '提示',

+ 1 - 1
src/components/upload/PublishAudio.vue

@@ -193,7 +193,7 @@ export default {
             type: 'warning',
             duration: 3000
           })
-          this.$router.push('/my/post/list/audio')
+          this.$router.push('/post/list/audio')
         } else {
           this.$notify({
             title: '提示',

+ 1 - 1
src/components/upload/PublishImage.vue

@@ -177,7 +177,7 @@ export default {
         this.submitForm.imageFileIds = Array.from(imageFileMap.values())
         submitAlbum(this.submitForm).then(res => {
           if (res.code === 0) {
-            this.$router.push('/my/post/list/image')
+            this.$router.push('/post/list/image')
           } else {
             this.$notify({
               title: '提示',

+ 1 - 1
src/components/upload/PublishVideo.vue

@@ -516,7 +516,7 @@ export default {
             type: 'warning',
             duration: 3000
           })
-          this.$router.push('/my/post/list/video')
+          this.$router.push('/post/list/video')
         } else {
           this.$notify({
             title: '提示',

+ 31 - 0
src/router/cam.js

@@ -0,0 +1,31 @@
+const Cam = () => import('views/cam/Cam')
+const CamList = () => import('views/cam/CamList')
+const LivePage = () => import('views/cam/LivePage')
+const RecordPage = () => import('views/cam/RecordPage')
+
+export default {
+  path: '/cam',
+  name: 'Cam',
+  component: Cam,
+  meta: { needAuth: true },
+  children: [
+    {
+      path: '/cam/list',
+      name: '摄像头列表',
+      component: CamList,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/cam/live/:camId',
+      name: 'LivePage',
+      component: LivePage,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/cam/record/:camId',
+      name: 'RecordPage',
+      component: RecordPage,
+      meta: { needAuth: true }
+    }
+  ]
+}

+ 10 - 321
src/router/index.js

@@ -1,8 +1,12 @@
 import VueRouter from 'vue-router'
 import Vue from 'vue'
+import MyRouter from './my'
+import AdminRouter from './admin'
+import UserRouter from './user'
 import MallRouter from './mall'
 import DiskRouter from './disk'
-import AdminRouter from './admin'
+import PostRouter from './post'
+import CamRouter from './cam'
 
 // 懒加载引入页面组件,es6语法
 // ********************************************************************************************************************
@@ -17,8 +21,6 @@ const VideoIndex = () => import('views/home/Video')
 const ShortVideoIndex = () => import('views/home/ShortVideo')
 const VideoPage = () => import('views/home/VideoPage')
 const VideoList = () => import('views/home/VideoList')
-const LivePage = () => import('views/cam/LivePage')
-const RecordPage = () => import('views/cam/RecordPage')
 const AudioIndex = () => import('views/home/Audio')
 const AudioPage = () => import('views/home/AudioPage')
 const ImageIndex = () => import('views/home/Image')
@@ -31,330 +33,17 @@ const DiscoverIndex = () => import('views/home/Discover')
 const BdMap = () => import('views/home/BdMap')
 const AMap = () => import('views/home/AMap')
 
-// ********************************************************************************************************************
-// 用户前台主页
-const UserHome = () => import('views/user/Home')
-const UserVideo = () => import('views/user/Home')
-const UserImage = () => import('views/user/Home')
-const UserAudio = () => import('views/user/Home')
-const UserArticle = () => import('views/user/Home')
-const UserRelation = () => import('views/user/UserRelation')
-
-// ********************************************************************************************************************
-// 用户后台主页
-const My = () => import('views/my/My')
-const MyProfile = () => import('views/my/MyProfile')
-const MyContact = () => import('views/my/MyContact')
-const MyRealname = () => import('views/my/MyRealname')
-const MessageIndex = () => import('views/my/Message')
-const MyVip = () => import('views/my/MyVip')
-const MyWallet = () => import('views/my/MyWallet')
-const FavlistVideo = () => import('views/my/FavlistVideo')
-const FavlistImage = () => import('views/my/FavlistImage')
-const HistoryIndex = () => import('views/my/History')
-const CamList = () => import('views/cam/CamList')
-
-// ********************************************************************************************************************
-// 稿件列表
-const PostList = () => import('views/post/PostList')
-const PostPublishVideo = () => import('components/upload/PublishVideo')
-const UserPostVideo = () => import('views/post/VideoPost')
-const PostEditVideo = () => import('components/upload/EditVideo')
-const PostPublishAudio = () => import('components/upload/PublishAudio')
-const UserPostAudio = () => import('views/post/AudioPost')
-const PostEditAudio = () => import('components/upload/EditAudio')
-const PostPublishAlbum = () => import('components/upload/PublishImage')
-const UserPostImage = () => import('views/post/ImagePost')
-const PostEditImage = () => import('components/upload/EditImage')
-const PostPublishArticle = () => import('components/upload/PublishArticle')
-const UserPostArticle = () => import('views/post/ArticlePost')
-const PostEditArticle = () => import('components/upload/EditArticle')
-const PostPublishFile = () => import('components/upload/PublishFile')
-
 // ********************************************************************************************************************
 // 使用安装路由插件
 Vue.use(VueRouter)
 const routes = [
+  MyRouter,
+  AdminRouter,
+  UserRouter,
   MallRouter,
   DiskRouter,
-  AdminRouter,
-  {
-    path: '/my',
-    name: 'My',
-    component: My,
-    meta: { needAuth: true },
-    children: [
-      {
-        path: '',
-        name: '个人资料',
-        component: MyProfile,
-        meta: { needAuth: true }
-      },
-      {
-        path: '/my/account/contact',
-        name: '联系人',
-        component: MyContact,
-        meta: { needAuth: true }
-      },
-      {
-        path: '/my/account/realname',
-        name: '实名认证',
-        component: MyRealname,
-        meta: { needAuth: true }
-      },
-      {
-        path: '/my/account/vip',
-        name: '小会员',
-        component: MyVip,
-        meta: { needAuth: true }
-      },
-      {
-        path: '/my/account/wallet',
-        name: '钱包',
-        component: MyWallet,
-        meta: { needAuth: true }
-      }
-    ]
-  },
-  {
-    path: '/my/post/publish',
-    name: 'MyPostPublish',
-    component: My,
-    meta: { needAuth: true },
-    children: [
-      {
-        path: '/my/post/publish/video',
-        name: '发布视频',
-        component: PostPublishVideo,
-        meta: { needAuth: true }
-      },
-      {
-        path: '/my/post/publish/audio',
-        name: '发布音频',
-        component: PostPublishAudio,
-        meta: { needAuth: true }
-      },
-      {
-        path: '/my/post/publish/image',
-        name: '发布相册',
-        component: PostPublishAlbum,
-        meta: { needAuth: true }
-      },
-      {
-        path: '/my/post/publish/article',
-        name: '发布文章',
-        component: PostPublishArticle,
-        meta: { needAuth: true }
-      },
-      {
-        path: '/my/post/publish/file',
-        name: '发布文件',
-        component: PostPublishFile,
-        meta: { needAuth: true }
-      }
-    ]
-  },
-  {
-    path: '/post',
-    name: 'PostList',
-    component: PostList,
-    meta: { needAuth: true },
-    children: [
-      {
-        path: '/post/video',
-        name: '视频稿件',
-        component: UserPostVideo,
-        meta: { needAuth: true }
-      },
-    ]
-  },
-  {
-    path: '/my/post/list',
-    name: 'MyPostList',
-    component: My,
-    meta: { needAuth: true },
-    children: [
-      {
-        path: '/my/post/list/video',
-        name: '视频稿件',
-        component: UserPostVideo,
-        meta: { needAuth: true }
-      },
-      {
-        path: '/my/post/list/audio',
-        name: '音频稿件',
-        component: UserPostAudio,
-        meta: { needAuth: true }
-      },
-      {
-        path: '/my/post/list/image',
-        name: '相册稿件',
-        component: UserPostImage,
-        meta: { needAuth: true }
-      },
-      {
-        path: '/my/post/list/article',
-        name: '文章稿件',
-        component: UserPostArticle,
-        meta: { needAuth: true }
-      }
-    ]
-  },
-  {
-    path: '/my/favlist',
-    name: 'MyFavlist',
-    component: My,
-    meta: { needAuth: true },
-    children: [
-      {
-        path: '/my/favlist/video',
-        name: '视频收藏',
-        component: FavlistVideo,
-        meta: { needAuth: true }
-      },
-      {
-        path: '/my/favlist/image',
-        name: '相册收藏',
-        component: FavlistImage,
-        meta: { needAuth: true }
-      }
-    ]
-  },
-  {
-    path: '/my/visit',
-    name: 'MyVisit',
-    component: My,
-    meta: { needAuth: true },
-    children: [
-      {
-        path: '/my/visit',
-        name: '浏览记录',
-        component: HistoryIndex,
-        meta: { needAuth: true }
-      }
-    ]
-  },
-  {
-    path: '/my/message',
-    name: 'MyMessage',
-    component: My,
-    meta: { needAuth: true },
-    children: [
-      {
-        path: '/my/message/receive',
-        name: '收到的消息',
-        component: MessageIndex,
-        meta: { needAuth: true }
-      }
-    ]
-  },
-  {
-    path: '/my/cam',
-    name: 'MyCam',
-    component: My,
-    meta: { needAuth: true },
-    children: [
-      {
-        path: '/my/cam/list',
-        name: '摄像头列表',
-        component: CamList,
-        meta: { needAuth: true }
-      },
-      {
-        path: '/my/cam/live/:camId',
-        name: 'LivePage',
-        component: LivePage,
-        meta: { needAuth: true }
-      },
-      {
-        path: '/my/cam/record/:camId',
-        name: 'RecordPage',
-        component: RecordPage,
-        meta: { needAuth: true }
-      }
-    ]
-  },
-  // ********************************************************************************************************************
-  {
-    path: '/my/post/edit/video/:videoId',
-    name: 'PostEditVideo',
-    component: PostEditVideo,
-    meta: { needAuth: true }
-  },
-  {
-    path: '/my/post/edit/audio/:audioId',
-    name: 'PostEditAudio',
-    component: PostEditAudio,
-    meta: { needAuth: true }
-  },
-  {
-    path: '/my/post/edit/album/:albumId',
-    name: 'PostEditImage',
-    component: PostEditImage,
-    meta: { needAuth: true }
-  },
-  {
-    path: '/my/post/edit/article/:articleId',
-    name: 'PostEditArticle',
-    component: PostEditArticle,
-    meta: { needAuth: true }
-  },
-  {
-    path: '/user',
-    name: 'Index',
-    component: Index,
-    meta: { needAuth: true },
-    children: [
-      {
-        path: '',
-        name: 'User',
-        component: () => import('@/views/404.vue'),
-        meta: { needAuth: false }
-      },
-      {
-        path: '/user/:id',
-        name: 'UserHome',
-        component: UserHome,
-        meta: { needAuth: false }
-      },
-      {
-        path: '/user/:id/video',
-        name: 'UserVideo',
-        component: UserVideo,
-        meta: { needAuth: false }
-      },
-      {
-        path: '/user/:id/image',
-        name: 'UserImage',
-        component: UserImage,
-        meta: { needAuth: false }
-      },
-      {
-        path: '/user/:id/audio',
-        name: 'UserAudio',
-        component: UserAudio,
-        meta: { needAuth: false }
-      },
-      {
-        path: '/user/:id/article',
-        name: 'UserArticle',
-        component: UserArticle,
-        meta: { needAuth: false }
-      },
-      {
-        path: '/user/:id/following',
-        name: 'UserRelation',
-        component: UserRelation,
-        meta: { needAuth: false }
-      },
-      {
-        path: '/user/:id/follower',
-        name: 'UserRelation',
-        component: UserRelation,
-        meta: { needAuth: false }
-      }
-    ]
-  },
+  PostRouter,
+  CamRouter,
   {
     path: '/',
     name: 'Index',

+ 54 - 0
src/router/my.js

@@ -0,0 +1,54 @@
+// ********************************************************************************************************************
+// 用户后台主页
+const My = () => import('views/my/My')
+const MyProfile = () => import('views/my/MyProfile')
+const MyContact = () => import('views/my/MyContact')
+const MyRealname = () => import('views/my/MyRealname')
+const MessageIndex = () => import('views/my/Message')
+const MyVip = () => import('views/my/MyVip')
+const MyWallet = () => import('views/my/MyWallet')
+
+export default {
+  path: '/my',
+  name: 'My',
+  component: My,
+  meta: { needAuth: true },
+  children: [
+    {
+      path: '',
+      name: '个人资料',
+      component: MyProfile,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/my/account/contact',
+      name: '联系人',
+      component: MyContact,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/my/account/realname',
+      name: '实名认证',
+      component: MyRealname,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/my/account/vip',
+      name: '小会员',
+      component: MyVip,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/my/account/wallet',
+      name: '钱包',
+      component: MyWallet,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/my/message',
+      name: '我的消息',
+      component: MessageIndex,
+      meta: { needAuth: true }
+    }
+  ]
+}

+ 124 - 0
src/router/post.js

@@ -0,0 +1,124 @@
+// ********************************************************************************************************************
+// 稿件
+const Post = () => import('views/post/Post')
+const History = () => import('views/post/History')
+const FavVideo = () => import('views/post/FavlistVideo')
+const FavImage = () => import('views/post/FavlistImage')
+const PostPublishVideo = () => import('components/upload/PublishVideo')
+const UserPostVideo = () => import('views/post/VideoPost')
+const PostEditVideo = () => import('components/upload/EditVideo')
+const PostPublishAudio = () => import('components/upload/PublishAudio')
+const UserPostAudio = () => import('views/post/AudioPost')
+const PostEditAudio = () => import('components/upload/EditAudio')
+const PostPublishAlbum = () => import('components/upload/PublishImage')
+const UserPostImage = () => import('views/post/ImagePost')
+const PostEditImage = () => import('components/upload/EditImage')
+const PostPublishArticle = () => import('components/upload/PublishArticle')
+const UserPostArticle = () => import('views/post/ArticlePost')
+const PostEditArticle = () => import('components/upload/EditArticle')
+const PostPublishFile = () => import('components/upload/PublishFile')
+
+export default {
+  path: '/post',
+  name: 'Post',
+  component: Post,
+  meta: { needAuth: true },
+  children: [
+    {
+      path: '',
+      name: 'PostIndex',
+      component: History,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/post/fav/video',
+      name: 'FavVideo',
+      component: FavVideo,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/post/fav/image',
+      name: 'FavImage',
+      component: FavImage,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/post/publish/video',
+      name: '发布视频',
+      component: PostPublishVideo,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/post/publish/audio',
+      name: '发布音频',
+      component: PostPublishAudio,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/post/publish/image',
+      name: '发布相册',
+      component: PostPublishAlbum,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/post/publish/article',
+      name: '发布文章',
+      component: PostPublishArticle,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/post/publish/file',
+      name: '发布文件',
+      component: PostPublishFile,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/post/list/video',
+      name: '视频稿件',
+      component: UserPostVideo,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/post/list/audio',
+      name: '音频稿件',
+      component: UserPostAudio,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/post/list/image',
+      name: '相册稿件',
+      component: UserPostImage,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/post/list/article',
+      name: '文章稿件',
+      component: UserPostArticle,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/post/edit/video/:videoId',
+      name: 'PostEditVideo',
+      component: PostEditVideo,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/post/edit/audio/:audioId',
+      name: 'PostEditAudio',
+      component: PostEditAudio,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/post/edit/album/:albumId',
+      name: 'PostEditImage',
+      component: PostEditImage,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/post/edit/article/:articleId',
+      name: 'PostEditArticle',
+      component: PostEditArticle,
+      meta: { needAuth: true }
+    },
+  ]
+}

+ 66 - 0
src/router/user.js

@@ -0,0 +1,66 @@
+const Index = () => import('views/Index')
+// ********************************************************************************************************************
+// 用户前台主页
+const UserHome = () => import('views/user/Home')
+const UserVideo = () => import('views/user/Home')
+const UserImage = () => import('views/user/Home')
+const UserAudio = () => import('views/user/Home')
+const UserArticle = () => import('views/user/Home')
+const UserRelation = () => import('views/user/UserRelation')
+
+export default {
+  path: '/user',
+  name: 'Index',
+  component: Index,
+  meta: { needAuth: true },
+  children: [
+    {
+      path: '',
+      name: 'User',
+      component: () => import('@/views/404.vue'),
+      meta: { needAuth: false }
+    },
+    {
+      path: '/user/:id',
+      name: 'UserHome',
+      component: UserHome,
+      meta: { needAuth: false }
+    },
+    {
+      path: '/user/:id/video',
+      name: 'UserVideo',
+      component: UserVideo,
+      meta: { needAuth: false }
+    },
+    {
+      path: '/user/:id/image',
+      name: 'UserImage',
+      component: UserImage,
+      meta: { needAuth: false }
+    },
+    {
+      path: '/user/:id/audio',
+      name: 'UserAudio',
+      component: UserAudio,
+      meta: { needAuth: false }
+    },
+    {
+      path: '/user/:id/article',
+      name: 'UserArticle',
+      component: UserArticle,
+      meta: { needAuth: false }
+    },
+    {
+      path: '/user/:id/following',
+      name: 'UserRelation',
+      component: UserRelation,
+      meta: { needAuth: false }
+    },
+    {
+      path: '/user/:id/follower',
+      name: 'UserRelation',
+      component: UserRelation,
+      meta: { needAuth: false }
+    }
+  ]
+}

+ 16 - 7
src/views/404.vue

@@ -1,15 +1,24 @@
 <template>
-  <div style="text-align: center;">
-    <h1>Not Found!</h1>
-    <p>
-      <a href="/">Go home?</a>
-    </p>
-  </div>
+  <el-container>
+    <el-main>
+      <nav-bar />
+      <el-row>
+        <div style="text-align: center;">
+          <h1>Not Found!</h1>
+        </div>
+      </el-row>
+    </el-main>
+  </el-container>
 </template>
 
 <script>
+import NavBar from 'components/layout/NavBar'
+
 export default {
-  name: 'NotFound'
+  name: 'NotFound',
+  components: {
+    NavBar
+  }
 }
 </script>
 

+ 98 - 0
src/views/cam/Cam.vue

@@ -0,0 +1,98 @@
+<template>
+  <el-container style="height: 800px; border: 1px solid #eee">
+    <el-header style="text-align: right; font-size: 12px">
+      <el-col :md="2">
+        <ul class="el-menu--horizontal el-menu">
+          <li class="el-menu-item">
+            <a href="/cam" style="text-decoration-line: none">
+              <img src="@/assets/img/icon/logo.png" class="el-avatar--circle el-avatar--medium" alt="img">
+              MyCam
+            </a>
+          </li>
+        </ul>
+      </el-col>
+      <el-dropdown>
+        <img
+          :src="user.avatarUrl"
+          class="el-avatar--circle el-avatar--medium"
+          style="margin-right: 10px; margin-top: 15px"
+          alt=""
+        >
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item
+            icon="el-icon-s-home"
+            class="size"
+            @click.native="goToHome"
+          >主页</el-dropdown-item>
+          <el-dropdown-item
+            icon="el-icon-error"
+            class="size"
+            @click.native="goToLogout"
+          >退出</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+    </el-header>
+    <el-container>
+      <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
+        <el-menu
+          :default-active="this.$route.path"
+          router
+          class="el-menu-vertical-demo"
+          :unique-opened="true"
+        >
+          <el-submenu index="/cam">
+            <template slot="title">
+              <i class="el-icon-camera" />
+              <span slot="title">我的监控</span>
+            </template>
+            <el-menu-item-group>
+              <el-menu-item index="/cam/list">
+                <i class="el-icon-camera" />
+                <span slot="title">摄像头列表</span>
+              </el-menu-item>
+            </el-menu-item-group>
+          </el-submenu>
+        </el-menu>
+      </el-aside>
+      <el-main>
+        <router-view />
+      </el-main>
+    </el-container>
+  </el-container>
+</template>
+
+<script>
+import { userMixin } from 'assets/js/mixin'
+import { getAuthedUser } from '@/utils/auth'
+
+export default {
+  name: 'Cam',
+  mixins: [userMixin],
+  data() {
+    return {
+      user: null,
+      loginUser: null
+    }
+  },
+  created() {
+    document.title = '我的摄像头'
+    const userInfo = getAuthedUser()
+    if (userInfo !== null) {
+      this.user = userInfo
+      this.loginUser = userInfo
+    }
+  }
+}
+</script>
+
+<style>
+.el-header {
+  background-color: #B3C0D1;
+  color: #333;
+  line-height: 60px;
+}
+
+.el-aside {
+  color: #333;
+}
+</style>

+ 2 - 2
src/views/cam/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="`/cam/live/${scope.row.camId}`">
               {{ scope.row.camName }}
             </router-link>
           </template>
@@ -311,7 +311,7 @@ export default {
       })
     },
     goToCamRecord(row) {
-      const path = '/my/cam/record/' + row.camId
+      const path = '/cam/record/' + row.camId
       if (this.$route.path === path) {
         this.$router.go(0)
         return

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

@@ -77,7 +77,7 @@ export default {
           this.initFlvPlayer(camId, flvUrl)
         } else {
           ele.innerHTML = '<h5>摄像头离线, 你可以查看本摄像头的' +
-            '<a style="text-decoration-line: none; color: red" target="_blank" href="/my/cam/record/' + this.camId + '">历史录像</a>' +
+            '<a style="text-decoration-line: none; color: red" target="_blank" href="/cam/record/' + this.camId + '">历史录像</a>' +
             '</h5>'
         }
       }
@@ -91,7 +91,7 @@ export default {
   },
   methods: {
     onSelect(value) {
-      const path = '/my/cam/live/' + value
+      const path = '/cam/live/' + value
       if (this.$route.path === path) {
         this.$router.go(0)
         return
@@ -123,7 +123,7 @@ export default {
       })
     },
     goToCamRecord() {
-      const path = '/my/cam/record/' + this.camId
+      const path = '/cam/record/' + this.camId
       if (this.$route.path === path) {
         this.$router.go(0)
         return

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

@@ -183,7 +183,7 @@ export default {
   },
   methods: {
     onSelect(value) {
-      const path = '/my/cam/record/' + value
+      const path = '/cam/record/' + value
       if (this.$route.path === path) {
         this.$router.go(0)
         return
@@ -261,7 +261,7 @@ export default {
       })
     },
     goToCamLive() {
-      const path = '/my/cam/live/' + this.camId
+      const path = '/cam/live/' + this.camId
       if (this.$route.path === path) {
         this.$router.go(0)
         return

+ 3 - 126
src/views/my/My.vue

@@ -64,134 +64,12 @@
               </el-menu-item>
             </el-menu-item-group>
           </el-submenu>
-          <el-submenu index="/my/post">
-            <template slot="title">
-              <i class="el-icon-postcard" />
-              <span slot="title">稿件管理</span>
-            </template>
-            <el-submenu index="/my/post/publish">
-              <template slot="title">
-                <i class="el-icon-plus" />
-                <span slot="title">发布</span>
-              </template>
-              <el-menu-item-group>
-                <el-menu-item index="/my/post/publish/video">
-                  <i class="el-icon-film" />
-                  <span slot="title">视频</span>
-                </el-menu-item>
-                <el-menu-item index="/my/post/publish/audio">
-                  <i class="el-icon-headset" />
-                  <span slot="title">音频</span>
-                </el-menu-item>
-                <el-menu-item index="/my/post/publish/image">
-                  <i class="el-icon-picture" />
-                  <span slot="title">相册</span>
-                </el-menu-item>
-                <el-menu-item index="/my/post/publish/article">
-                  <i class="el-icon-document" />
-                  <span slot="title">文章</span>
-                </el-menu-item>
-                <el-menu-item index="/my/post/publish/file">
-                  <i class="el-icon-files" />
-                  <span slot="title">文件</span>
-                </el-menu-item>
-              </el-menu-item-group>
-            </el-submenu>
-            <el-submenu index="/my/post/list">
-              <template slot="title">
-                <i class="el-icon-s-data" />
-                <span slot="title">稿件</span>
-              </template>
-              <el-menu-item-group>
-                <el-menu-item index="/my/post/list/video">
-                  <i class="el-icon-film" />
-                  <span slot="title">视频</span>
-                </el-menu-item>
-                <el-menu-item index="/my/post/list/audio">
-                  <i class="el-icon-headset" />
-                  <span slot="title">音频</span>
-                </el-menu-item>
-                <el-menu-item index="/my/post/list/image">
-                  <i class="el-icon-picture" />
-                  <span slot="title">相册</span>
-                </el-menu-item>
-                <el-menu-item index="/my/post/list/article">
-                  <i class="el-icon-document" />
-                  <span slot="title">文章</span>
-                </el-menu-item>
-              </el-menu-item-group>
-            </el-submenu>
-          </el-submenu>
-          <el-submenu index="/my/favlist">
-            <template slot="title">
-              <i class="el-icon-collection" />
-              <span slot="title">收藏夹</span>
-            </template>
-            <el-menu-item-group>
-              <el-menu-item index="/my/favlist/video">
-                <i class="el-icon-film" />
-                <span slot="title">视频</span>
-              </el-menu-item>
-              <el-menu-item index="/my/favlist/image">
-                <i class="el-icon-picture" />
-                <span slot="title">相册</span>
-              </el-menu-item>
-            </el-menu-item-group>
-          </el-submenu>
-          <el-menu-item index="/my/visit">
-            <i class="el-icon-document" />
-            <span slot="title">历史记录</span>
+          <el-menu-item index="/my/message">
+            <i class="el-icon-message" />
+            <span slot="title">我的消息</span>
           </el-menu-item>
-          <el-submenu index="/my/message">
-            <template slot="title">
-              <i class="el-icon-message" />
-              <span slot="title">我的消息</span>
-            </template>
-            <el-menu-item-group>
-              <el-menu-item index="/my/message/receive">
-                <i class="el-icon-back" />
-                <span slot="title">收到的消息</span>
-              </el-menu-item>
-            </el-menu-item-group>
-          </el-submenu>
-          <el-submenu index="/my/cam">
-            <template slot="title">
-              <i class="el-icon-camera" />
-              <span slot="title">我的监控</span>
-            </template>
-            <el-menu-item-group>
-              <el-menu-item index="/my/cam/list">
-                <i class="el-icon-camera" />
-                <span slot="title">摄像头列表</span>
-              </el-menu-item>
-            </el-menu-item-group>
-          </el-submenu>
         </el-menu>
       </el-aside>
-<!--      <el-row class="movie-list">
-        <el-col :md="12" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
-          <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
-            <el-card class="box-card">
-              <div slot="header" class="clearfix">
-                <span>我的资料</span>
-              </div>
-              <div class="text item">
-                <el-form ref="form" :model="loginUser" label-width="80px">
-                  <el-form-item label="ID">
-                    <el-input v-model="loginUser.userId" style="padding-right: 1px" readonly />
-                  </el-form-item>
-                  <el-form-item label="显示名">
-                    <el-input v-model="loginUser.screenName" style="padding-right: 1px" readonly />
-                  </el-form-item>
-                  <el-form-item label="签名">
-                    <el-input v-model="loginUser.signature" style="padding-right: 1px" readonly />
-                  </el-form-item>
-                </el-form>
-              </div>
-            </el-card>
-          </el-row>
-        </el-col>
-      </el-row>-->
       <el-main>
         <router-view />
       </el-main>
@@ -219,7 +97,6 @@ export default {
       this.user = userInfo
       this.loginUser = userInfo
     }
-    console.log(process.env)
   }
 }
 </script>

+ 0 - 2
src/views/my/MyProfile.vue

@@ -87,9 +87,7 @@ export default {
     }
   },
   created() {
-    document.title = '我的个人资料'
     this.loginUser = getAuthedUser()
-
     getServerInfo(this.imgData.channelId).then(res => {
       if (res.code === 0) {
         const resData = res.data

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

@@ -160,7 +160,7 @@ export default {
       this.showEditScopeDialog = true
     },
     handleEdit(index, row) {
-      const path = '/my/post/edit/article/' + row.articleId
+      const path = '/post/edit/article/' + row.articleId
       this.$router.push(path)
     },
     handleDelete(index, row) {

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

@@ -170,7 +170,7 @@ export default {
       this.showEditScopeDialog = true
     },
     handleEdit(index, row) {
-      const path = '/my/post/edit/audio/' + row.audioId
+      const path = '/post/edit/audio/' + row.audioId
       this.$router.push(path)
     },
     handleDelete(index, row) {

+ 0 - 0
src/views/my/FavlistImage.vue → src/views/post/FavlistImage.vue


+ 0 - 0
src/views/my/FavlistVideo.vue → src/views/post/FavlistVideo.vue


+ 0 - 0
src/views/my/History.vue → src/views/post/History.vue


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

@@ -181,7 +181,7 @@ export default {
       this.showEditScopeDialog = true
     },
     handleEdit(index, row) {
-      const path = '/my/post/edit/album/' + row.albumId
+      const path = '/post/edit/album/' + row.albumId
       this.$router.push(path)
     },
     handleDelete(index, row) {

+ 154 - 0
src/views/post/Post.vue

@@ -0,0 +1,154 @@
+<template>
+  <el-container style="height: 800px; border: 1px solid #eee">
+    <el-header style="text-align: right; font-size: 12px">
+      <el-col :md="2">
+        <ul class="el-menu--horizontal el-menu">
+          <li class="el-menu-item">
+            <a href="/post" style="text-decoration-line: none">
+              <img src="@/assets/img/icon/logo.png" class="el-avatar--circle el-avatar--medium" alt="img">
+              MyPost
+            </a>
+          </li>
+        </ul>
+      </el-col>
+      <el-dropdown>
+        <img
+          :src="user.avatarUrl"
+          class="el-avatar--circle el-avatar--medium"
+          style="margin-right: 10px; margin-top: 15px"
+          alt=""
+        >
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item
+            icon="el-icon-s-home"
+            class="size"
+            @click.native="goToHome"
+          >主页</el-dropdown-item>
+          <el-dropdown-item
+            icon="el-icon-error"
+            class="size"
+            @click.native="goToLogout"
+          >退出</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+    </el-header>
+    <el-container>
+      <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
+        <el-menu
+          :default-active="this.$route.path"
+          router
+          class="el-menu-vertical-demo"
+          :unique-opened="true"
+        >
+          <el-submenu index="/post/publish">
+            <template slot="title">
+              <i class="el-icon-plus" />
+              <span slot="title">发布稿件</span>
+            </template>
+            <el-menu-item-group>
+              <el-menu-item index="/post/publish/video">
+                <i class="el-icon-film" />
+                <span slot="title">视频</span>
+              </el-menu-item>
+              <el-menu-item index="/post/publish/audio">
+                <i class="el-icon-headset" />
+                <span slot="title">音频</span>
+              </el-menu-item>
+              <el-menu-item index="/post/publish/image">
+                <i class="el-icon-picture" />
+                <span slot="title">相册</span>
+              </el-menu-item>
+              <el-menu-item index="/post/publish/article">
+                <i class="el-icon-document" />
+                <span slot="title">文章</span>
+              </el-menu-item>
+              <el-menu-item index="/post/publish/file">
+                <i class="el-icon-files" />
+                <span slot="title">文件</span>
+              </el-menu-item>
+            </el-menu-item-group>
+          </el-submenu>
+          <el-submenu index="/post/list">
+            <template slot="title">
+              <i class="el-icon-s-data" />
+              <span slot="title">管理稿件</span>
+            </template>
+            <el-menu-item-group>
+              <el-menu-item index="/post/list/video">
+                <i class="el-icon-film" />
+                <span slot="title">视频</span>
+              </el-menu-item>
+              <el-menu-item index="/post/list/audio">
+                <i class="el-icon-headset" />
+                <span slot="title">音频</span>
+              </el-menu-item>
+              <el-menu-item index="/post/list/image">
+                <i class="el-icon-picture" />
+                <span slot="title">相册</span>
+              </el-menu-item>
+              <el-menu-item index="/post/list/article">
+                <i class="el-icon-document" />
+                <span slot="title">文章</span>
+              </el-menu-item>
+            </el-menu-item-group>
+          </el-submenu>
+          <el-submenu index="/post/fav">
+            <template slot="title">
+              <i class="el-icon-collection" />
+              <span slot="title">收藏夹</span>
+            </template>
+            <el-menu-item-group>
+              <el-menu-item index="/post/fav/video">
+                <i class="el-icon-film" />
+                <span slot="title">视频</span>
+              </el-menu-item>
+              <el-menu-item index="/post/fav/image">
+                <i class="el-icon-picture" />
+                <span slot="title">相册</span>
+              </el-menu-item>
+            </el-menu-item-group>
+          </el-submenu>
+        </el-menu>
+      </el-aside>
+      <el-main>
+        <router-view />
+      </el-main>
+    </el-container>
+  </el-container>
+</template>
+
+<script>
+import { userMixin } from 'assets/js/mixin'
+import { getAuthedUser } from '@/utils/auth'
+
+export default {
+  name: 'Post',
+  mixins: [userMixin],
+  data() {
+    return {
+      user: null,
+      loginUser: null
+    }
+  },
+  created() {
+    document.title = '我的稿件'
+    const userInfo = getAuthedUser()
+    if (userInfo !== null) {
+      this.user = userInfo
+      this.loginUser = userInfo
+    }
+  }
+}
+</script>
+
+<style>
+.el-header {
+  background-color: #B3C0D1;
+  color: #333;
+  line-height: 60px;
+}
+
+.el-aside {
+  color: #333;
+}
+</style>

+ 0 - 253
src/views/post/PostList.vue

@@ -1,253 +0,0 @@
-<template>
-  <el-row>
-    <el-col :md="2">
-      <el-menu
-        :default-active="this.$route.path"
-        router
-        class="el-menu-vertical-demo"
-      >
-        <el-menu-item v-for="(item,i) in navList" :key="i" :index="item.path">
-          <i :class="item.icon" />
-          <span slot="title">{{ item.name }}</span>
-        </el-menu-item>
-      </el-menu>
-    </el-col>
-    <el-col :md="22">
-      <el-row>
-        <el-tabs v-model="activeName" @tab-click="tabClick">
-          <el-tab-pane label="视频" name="video">
-            <video-post :data-list="dataList" />
-          </el-tab-pane>
-          <el-tab-pane label="音频" name="audio">
-            <audio-post :data-list="dataList" />
-          </el-tab-pane>
-          <el-tab-pane label="相册" name="image">
-            <image-post :data-list="dataList" />
-          </el-tab-pane>
-          <el-tab-pane label="文章" name="article">
-            <article-post :data-list="dataList" />
-          </el-tab-pane>
-        </el-tabs>
-      </el-row>
-      <el-row>
-        <el-col :span="22" class="pagination">
-          <el-pagination
-            background
-            :small="screenWidth <= 768"
-            layout="prev, pager, next"
-            :page-size="pageSize"
-            :current-page="currentPage"
-            :total="totalSize"
-            @current-change="handleCurrentChange"
-            @prev-click="handleCurrentChange"
-            @next-click="handleCurrentChange"
-          />
-        </el-col>
-      </el-row>
-    </el-col>
-  </el-row>
-</template>
-
-<script>
-import VideoPost from '@/views/post/VideoPost'
-import AudioPost from '@/views/post/AudioPost'
-import ImagePost from '@/views/post/ImagePost'
-import ArticlePost from '@/views/post/ArticlePost'
-
-import { getVideoPosts } from '@/api/video'
-import { getAudioPosts } from '@/api/audio'
-import { getUserAlbums } from '@/api/image'
-import { getArticlePosts } from '@/api/article'
-
-export default {
-  name: 'PostList',
-  components: { VideoPost, ImagePost, AudioPost, ArticlePost },
-  data() {
-    return {
-      // 屏幕宽度, 为了控制分页条的大小
-      screenWidth: document.body.clientWidth,
-      currentPage: 1,
-      pageSize: 12,
-      totalSize: 0,
-      dataList: [],
-      /** ***********************************************************************/
-      navList: [
-        { path: '/post/publish', name: '发布', icon: 'el-icon-upload' },
-        { path: '/post/list', name: '稿件', icon: 'el-icon-files' },
-        { path: '/post/analysis', name: '数据', icon: 'el-icon-data-analysis' }
-      ],
-      activeName: 'video',
-      userId: 10001,
-      showPreviewDialog: false,
-      videoProp: null,
-      showEditScopeDialog: false
-    }
-  },
-  watch: {
-    $route() {
-      this.$router.go()
-    }
-  },
-  created() {
-    document.title = '稿件列表'
-
-    const path = this.$route.path
-    if (path.endsWith('video')) {
-      this.activeName = 'video'
-      document.title = '视频稿件'
-    } else if (path.endsWith('image')) {
-      this.activeName = 'image'
-      document.title = '图片稿件'
-    } else if (path.endsWith('audio')) {
-      this.activeName = 'audio'
-      document.title = '音频稿件'
-    } else if (path.endsWith('article')) {
-      this.activeName = 'article'
-      document.title = '文章稿件'
-    }
-
-    this.getData()
-  },
-  methods: {
-    handleCurrentChange(pageNumber) {
-      this.currentPage = pageNumber
-      this.getData()
-      // 回到顶部
-      scrollTo(0, 0)
-    },
-    tabClick(tab) {
-      this.activeName = tab.name
-      this.goToTab(this.activeName)
-    },
-    goToTab(activeName) {
-      const path = '/post/' + activeName
-      if (this.$route.path === path) {
-        this.$router.go(0)
-        return
-      }
-      this.$router.push(path)
-    },
-    getData() {
-      this.dataList = []
-      if (this.activeName === 'video') {
-        getVideoPosts(this.currentPage).then(res => {
-          if (res.code === 0) {
-            const resData = res.data
-            this.dataList = resData.list
-            this.totalSize = resData.totalSize
-
-            if (this.totalSize !== 0) {
-              this.showEmpty = false
-            } else {
-              this.showEmpty = true
-            }
-          } else {
-            this.$notify({
-              title: '提示',
-              message: res.msg,
-              type: 'warning',
-              duration: 3000
-            })
-          }
-        }).catch(error => {
-          this.$notify({
-            title: '提示',
-            message: error.message,
-            type: 'error',
-            duration: 3000
-          })
-        })
-      } else if (this.activeName === 'image') {
-        getUserAlbums(this.userId).then(res => {
-          if (res.code === 0) {
-            const resData = res.data
-            if (resData.length !== 0) {
-              this.showEmpty = false
-              for (const item of resData) {
-                this.dataList.push(item)
-              }
-            } else {
-              this.showEmpty = true
-            }
-          }
-        })
-      } else if (this.activeName === 'audio') {
-        this.currentPage = 1
-        this.lastId = 0
-        getAudioPosts(this.currentPage).then(res => {
-          if (res.code === 0) {
-            const resData = res.data.list
-            if (resData.length !== 0) {
-              this.showEmpty = false
-              for (const item of resData) {
-                this.dataList.push(item)
-              }
-            } else {
-              this.showEmpty = true
-            }
-          }
-        })
-      } else if (this.activeName === 'article') {
-        this.currentPage = 1
-        this.lastId = 0
-        getArticlePosts(this.currentPage).then(res => {
-          if (res.code === 0) {
-            const resData = res.data.list
-            if (resData.length !== 0) {
-              this.showEmpty = false
-              for (const item of resData) {
-                this.dataList.push(item)
-              }
-            } else {
-              this.showEmpty = true
-            }
-          }
-        })
-      }
-    }
-  }
-}
-</script>
-
-<style>
-.uploader-example {
-  width: 500px;
-  padding: 15px;
-  margin: 40px auto 0;
-  font-size: 12px;
-  box-shadow: 0 0 10px rgba(0, 0, 0, .4);
-}
-.uploader-example .uploader-btn {
-  margin-right: 4px;
-}
-.uploader-example .uploader-list {
-  max-height: 440px;
-  overflow: auto;
-  overflow-x: hidden;
-  overflow-y: auto;
-}
-
-.avatar-uploader .el-upload {
-  border: 1px dashed #d9d9d9;
-  border-radius: 6px;
-  cursor: pointer;
-  position: relative;
-  overflow: hidden;
-}
-.avatar-uploader .el-upload:hover {
-  border-color: #409EFF;
-}
-.avatar-uploader-icon {
-  font-size: 28px;
-  color: #8c939d;
-  width: 320px;
-  height: 240px;
-  line-height: 178px;
-  text-align: center;
-}
-.avatar {
-  width: 320px;
-  height: 240px;
-  display: block;
-}
-</style>

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

@@ -303,7 +303,7 @@ export default {
       })
     },
     handleEdit(index, row) {
-      const path = '/my/post/edit/video/' + row.videoId
+      const path = '/post/edit/video/' + row.videoId
       this.$router.push(path)
     },
     handleDelete(index, row) {