Преглед изворни кода

添加 /admin 路由下的子路由和新页面

reghao пре 2 година
родитељ
комит
22561f384c
5 измењених фајлова са 558 додато и 165 уклоњено
  1. 7 1
      src/api/user.js
  2. 446 0
      src/components/admin/AdminEditVideo.vue
  3. 7 0
      src/router/index.js
  4. 42 25
      src/views/admin/AdminPost.vue
  5. 56 139
      src/views/admin/AdminUser.vue

+ 7 - 1
src/api/user.js

@@ -13,7 +13,9 @@ const userApi = {
   userFollowingApi: '/api/user/relation/following',
   userFollowingApi: '/api/user/relation/following',
   vipPlanApi: '/api/user/vip/plan',
   vipPlanApi: '/api/user/vip/plan',
   vipOrderApi: '/api/user/vip/order',
   vipOrderApi: '/api/user/vip/order',
-  vipPayApi: '/api/user/vip/pay'
+  vipPayApi: '/api/user/vip/pay',
+
+  userListApi: '/api/user/list'
 }
 }
 
 
 export function getMyInfo() {
 export function getMyInfo() {
@@ -75,3 +77,7 @@ export function createVipOrder(planId) {
 export function payVip(orderId) {
 export function payVip(orderId) {
   return post(userApi.vipPayApi + '/' + orderId)
   return post(userApi.vipPayApi + '/' + orderId)
 }
 }
+
+export function getUserList(page) {
+  return get(userApi.userListApi + "?page=" + page)
+}

+ 446 - 0
src/components/admin/AdminEditVideo.vue

@@ -0,0 +1,446 @@
+<template>
+  <el-row class="movie-list">
+    <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
+      <el-col :md="24" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
+        <el-card class="box-card">
+          <div class="text item">
+            <el-button style="float: left; padding: 3px 0" type="text" @click="onReturnVideo">返回视频列表</el-button>
+          </div>
+        </el-card>
+      </el-col>
+    </el-row>
+    <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
+      <el-col :md="8" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
+        <el-card class="box-card">
+          <div slot="header" class="clearfix">
+            <span>更新视频信息</span>
+            <el-button style="float: right; padding: 3px 0" type="text" @click="onUpdateVideoInfo">更新</el-button>
+          </div>
+          <div class="text item">
+            <el-form ref="form" :model="videoInfoForm" label-width="80px">
+              <el-form-item label="标题">
+                <el-input v-model="videoInfoForm.title" style="padding-right: 1px" placeholder="标题不能超过 50 个字符" />
+              </el-form-item>
+              <el-form-item label="描述">
+                <el-input v-model="videoInfoForm.description" type="textarea" autosize style="padding-right: 1px;" />
+              </el-form-item>
+              <el-form-item label="发布时间">
+                <el-date-picker
+                  v-model="videoInfoForm.pubDate"
+                  type="datetime"
+                  placeholder="选择发布的时间">
+                </el-date-picker>
+              </el-form-item>
+            </el-form>
+          </div>
+        </el-card>
+      </el-col>
+      <el-col :md="8" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
+        <el-card class="box-card">
+          <div slot="header" class="clearfix">
+            <span>更新视频封面</span>
+            <el-button style="float: right; padding: 3px 0" type="text" @click="onUpdateVideoCover">更新</el-button>
+          </div>
+          <div class="text item">
+            <el-tooltip class="item" effect="dark" content="点击上传图片" placement="top-end">
+              <el-upload
+                class="avatar-uploader"
+                action="//oss.reghao.cn/"
+                :headers="imgHeaders"
+                :data="imgData"
+                :with-credentials="true"
+                :show-file-list="false"
+                :before-upload="beforeAvatarUpload"
+                :on-success="handleAvatarSuccess"
+                :on-change="handleOnChange"
+              >
+                <img :src="coverUrl" class="avatar">
+              </el-upload>
+            </el-tooltip>
+          </div>
+        </el-card>
+      </el-col>
+    </el-row>
+    <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
+      <el-col :md="12" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
+        <el-card class="box-card">
+          <div slot="header" class="clearfix">
+            <span>更新视频文件</span>
+            <el-button style="float: right; padding: 3px 0" type="text" @click="onUpdateVideoFile">更新</el-button>
+          </div>
+          <div class="text item">
+            <uploader
+              class="uploader-example"
+              :options="options"
+              :auto-start="true"
+              @file-added="onFileAdded"
+              @file-success="onFileSuccess"
+              @file-progress="onFileProgress"
+              @file-error="onFileError"
+            >
+              <uploader-unsupport />
+              <uploader-drop>
+                <p>拖动视频文件到此处或</p>
+                <uploader-btn :attrs="attrs">选择视频文件</uploader-btn>
+              </uploader-drop>
+              <uploader-list />
+            </uploader>
+          </div>
+        </el-card>
+      </el-col>
+    </el-row>
+  </el-row>
+</template>
+
+<script>
+import { getServerInfo } from '@/api/file'
+import { getUserVideoPost, updateVideoInfo, updateVideoCover, updateVideoFile } from '@/api/video'
+
+export default {
+  name: 'AdminEditVideo',
+  data() {
+    return {
+      /***********************************************************************/
+      options: {
+        target: '//oss.reghao.cn/',
+        chunkSize: 1024 * 1024 * 1024 * 5, // 5GiB
+        fileParameterName: 'file',
+        testChunks: false,
+        query: (file, chunk) => {
+          return {
+            channelId: 2
+          }
+        },
+        headers: {
+          Authorization: ''
+        },
+        withCredentials: true,
+      },
+      attrs: {
+        accept: 'video/*'
+      },
+      imgHeaders: {
+        Authorization: ''
+      },
+      imgData: {
+        channelId: 5
+      },
+      /***********************************************************************/
+      coverUrl: null,
+      coverUrl1: null,
+      coverFileId: null,
+      videoFileId: null,
+      // 提交给后端的数据
+      videoInfoForm: {
+        videoId: null,
+        title: null,
+        description: null,
+        pubDate: null
+      },
+      ossToken: null,
+    }
+  },
+  created() {
+    document.title = '管理员编辑视频'
+
+    const videoId = this.$route.params.videoId
+    getUserVideoPost(videoId).then(res => {
+      if (res.code === 0) {
+        const userVideoPost = res.data
+        this.coverUrl = userVideoPost.coverUrl
+        this.videoInfoForm.videoId = userVideoPost.videoId
+        this.videoInfoForm.title = userVideoPost.title
+        this.videoInfoForm.description = userVideoPost.description
+        this.videoInfoForm.pubDate = userVideoPost.pubDate
+      } else {
+        this.$notify({
+          title: '提示',
+          message: '获取 OSS 服务器地址失败, 暂时无法上传文件',
+          type: 'error',
+          duration: 3000
+        })
+      }
+    }).catch(error => {
+      this.$notify({
+        title: '提示',
+        message: error.message,
+        type: 'warning',
+        duration: 3000
+      })
+    })
+
+    getServerInfo(2).then(res => {
+      if (res.code === 0) {
+        const resData = res.data
+        this.options.target = resData.ossUrl
+        this.options.chunkSize = resData.maxSize
+        this.options.headers.Authorization = "Bearer " + resData.token
+      } else {
+        this.$notify({
+          title: '提示',
+          message: '获取 OSS 服务器地址失败, 暂时无法上传文件',
+          type: 'error',
+          duration: 3000
+        })
+      }
+    }).catch(error => {
+      this.$notify({
+        title: '提示',
+        message: '视频上传配置失败 ' + error.message,
+        type: 'warning',
+        duration: 3000
+      })
+    })
+
+    getServerInfo(5).then(res => {
+      if (res.code === 0) {
+        const resData = res.data
+        this.imgHeaders.Authorization = 'Bearer ' + resData.token
+      } else {
+        this.$notify({
+          title: '提示',
+          message: '获取 OSS 服务器地址失败, 暂时无法上传文件',
+          type: 'error',
+          duration: 3000
+        })
+      }
+    }).catch(error => {
+      this.$notify({
+        title: '提示',
+        message: '图片上传配置失败 ' + error.message,
+        type: 'warning',
+        duration: 3000
+      })
+    })
+  },
+  methods: {
+    /***********************************************************************/
+    onFileAdded(file) {
+      if (file.file.size > 1024*1024*1024*5) {
+        file.cancel()
+        this.$notify(
+          {
+            title: '提示',
+            message: '视频文件应小于 5GiB',
+            type: 'warning',
+            duration: 3000
+          }
+        )
+        return
+      }
+    },
+    onFileProgress(rootFile, file, chunk) {
+    },
+    onFileSuccess(rootFile, file, response, chunk) {
+      const res = JSON.parse(response)
+      if (res.code === 0) {
+        const resData = res.data
+        this.videoFileId = resData.uploadId
+
+        this.$notify(
+          {
+            title: '提示',
+            message: '视频已上传',
+            type: 'warning',
+            duration: 3000
+          }
+        )
+      }
+    },
+    onFileError(rootFile, file, response, chunk) {
+      this.$notify(
+        {
+          title: '提示',
+          message: '文件上传错误',
+          type: 'warning',
+          duration: 3000
+        }
+      )
+    },
+    /***********************************************************************/
+    beforeAvatarUpload(file) {
+      const isJPG = file.type === 'image/jpeg'
+      const isLt2M = file.size / 1024 / 1024 < 2
+      if (!isJPG) {
+        this.$message.error('上传头像图片只能是 JPG 格式!')
+      }
+      if (!isLt2M) {
+        this.$message.error('上传头像图片大小不能超过 2MB!')
+      }
+      return isJPG && isLt2M
+    },
+    handleAvatarSuccess(res, file) {
+      const localImageUrl = URL.createObjectURL(file.raw)
+      if (res.code === 0) {
+        const resData = res.data
+        this.coverFileId = resData.uploadId
+        this.coverUrl = localImageUrl
+        this.coverUrl1 = resData.url
+      } else {
+        this.$notify({
+          title: '提示',
+          message: '视频封面上传失败,请重试!' + res.msg,
+          type: 'warning',
+          duration: 3000
+        })
+      }
+    },
+    handleOnChange(file, fileList) {
+    },
+    /***********************************************************************/
+    onReturnVideo() {
+      this.$router.push('/admin/post/video')
+    },
+    onUpdateVideoInfo() {
+      updateVideoInfo(this.videoInfoForm).then(res => {
+        if (res.code === 0) {
+          this.$notify({
+            title: '提示',
+            message: '视频信息已更新',
+            type: 'warning',
+            duration: 3000
+          })
+        }
+      }).catch(error => {
+        this.$notify({
+          title: '提示',
+          message: error.message,
+          type: 'warning',
+          duration: 3000
+        })
+      })
+    },
+    onUpdateVideoCover() {
+      if (this.coverUrl1 === null) {
+        this.$notify({
+          title: '提示',
+          message: '你还没有上传视频封面',
+          type: 'warning',
+          duration: 3000
+        })
+        return
+      }
+
+      const videoCover = {
+        videoId: this.videoInfoForm.videoId,
+        coverUrl: this.coverUrl1,
+        coverFileId: this.coverFileId
+      }
+
+      updateVideoCover(videoCover).then(res => {
+        if (res.code === 0) {
+          this.$notify({
+            title: '提示',
+            message: '视频封面已更新',
+            type: 'warning',
+            duration: 3000
+          })
+        }
+      }).catch(error => {
+        this.$notify({
+          title: '提示',
+          message: error.message,
+          type: 'warning',
+          duration: 3000
+        })
+      })
+    },
+    onUpdateVideoFile() {
+      if (this.videoFileId === null) {
+        this.$notify({
+          title: '提示',
+          message: '你还没有上传视频文件',
+          type: 'warning',
+          duration: 3000
+        })
+        return
+      }
+
+      const videoFile = {
+        videoId: this.videoInfoForm.videoId,
+        videoFileId: this.videoFileId
+      }
+
+      updateVideoFile(videoFile).then(res => {
+        if (res.code === 0) {
+          this.$notify({
+            title: '提示',
+            message: '视频文件已更新',
+            type: 'warning',
+            duration: 3000
+          })
+        }
+      }).catch(error => {
+        this.$notify({
+          title: '提示',
+          message: error.message,
+          type: 'warning',
+          duration: 3000
+        })
+      })
+    },
+  }
+}
+</script>
+
+<style>
+/*处于手机屏幕时*/
+@media screen and (max-width: 768px){
+  .movie-list {
+    padding-top: 8px;
+    padding-left: 0.5%;
+    padding-right: 0.5%;
+  }
+
+  .coverImg {
+    height: 120px !important;
+  }
+}
+
+.movie-list {
+  padding-top: 15px;
+  padding-left: 6%;
+  padding-right: 6%;
+}
+
+.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>

+ 7 - 0
src/router/index.js

@@ -1,5 +1,6 @@
 import VueRouter from 'vue-router'
 import VueRouter from 'vue-router'
 import Vue from 'vue'
 import Vue from 'vue'
+import EditVideo from "@/components/upload/EditVideo";
 
 
 // 懒加载引入页面组件,es6语法
 // 懒加载引入页面组件,es6语法
 const Home = () => import('views/home/Index')
 const Home = () => import('views/home/Index')
@@ -47,6 +48,7 @@ const AdminPostVideo = () => import('views/admin/AdminPost')
 const AdminPostAudio = () => import('views/admin/AdminPost')
 const AdminPostAudio = () => import('views/admin/AdminPost')
 const AdminPostImage = () => import('views/admin/AdminPost')
 const AdminPostImage = () => import('views/admin/AdminPost')
 const AdminPostArticle = () => import('views/admin/AdminPost')
 const AdminPostArticle = () => import('views/admin/AdminPost')
+const AdminEditVideo = () => import('components/admin/AdminEditVideo')
 
 
 // 使用安装路由插件
 // 使用安装路由插件
 Vue.use(VueRouter)
 Vue.use(VueRouter)
@@ -321,6 +323,11 @@ const routes = [
     name: 'AdminPostArticle',
     name: 'AdminPostArticle',
     component: AdminPostArticle
     component: AdminPostArticle
   },
   },
+  {
+    path: '/admin/edit/video/:videoId',
+    name: 'AdminEditVideo',
+    component: AdminEditVideo
+  },
   {
   {
     path: '*',
     path: '*',
     name: '404',
     name: '404',

+ 42 - 25
src/views/admin/AdminPost.vue

@@ -26,7 +26,8 @@
                 </el-table-column>
                 </el-table-column>
                 <el-table-column
                 <el-table-column
                   prop="pubDate"
                   prop="pubDate"
-                  label="发布时间">
+                  label="发布时间"
+                  fixed="left">
                 </el-table-column>
                 </el-table-column>
                 <el-table-column
                 <el-table-column
                   prop="coverUrl"
                   prop="coverUrl"
@@ -57,27 +58,25 @@
                   prop="scope"
                   prop="scope"
                   label="可见范围">
                   label="可见范围">
                   <template slot-scope="scope">
                   <template slot-scope="scope">
-                    <el-tooltip class="item" effect="dark" content="点击修改视频可见范围" placement="top-end">
-                      <el-button
-                        v-if="scope.row.scope === 1"
-                        size="mini"
-                        @click="handleScope(scope.$index, scope.row)">所有人可见</el-button>
-                      <el-button
-                        v-else-if="scope.row.scope === 2"
-                        size="mini"
-                        type="success"
-                        @click="handleScope(scope.$index, scope.row)">VIP 可见</el-button>
-                      <el-button
-                        v-else-if="scope.row.scope === 3"
-                        size="mini"
-                        type="warning"
-                        @click="handleScope(scope.$index, scope.row)">验证码可见</el-button>
-                      <el-button
-                        v-else
-                        size="mini"
-                        type="danger"
-                        @click="handleScope(scope.$index, scope.row)">本人可见</el-button>
-                    </el-tooltip>
+                    <el-button
+                      v-if="scope.row.scope === 1"
+                      size="mini"
+                    >所有人可见</el-button>
+                    <el-button
+                      v-else-if="scope.row.scope === 2"
+                      size="mini"
+                      type="success"
+                    >VIP 可见</el-button>
+                    <el-button
+                      v-else-if="scope.row.scope === 3"
+                      size="mini"
+                      type="warning"
+                    >验证码可见</el-button>
+                    <el-button
+                      v-else
+                      size="mini"
+                      type="danger"
+                    >本人可见</el-button>
                   </template>
                   </template>
                 </el-table-column>
                 </el-table-column>
                 <el-table-column
                 <el-table-column
@@ -93,16 +92,31 @@
                     <el-tag v-else-if="scope.row.status === 3" :type="'danger'" disable-transitions>
                     <el-tag v-else-if="scope.row.status === 3" :type="'danger'" disable-transitions>
                       审核未通过
                       审核未通过
                     </el-tag>
                     </el-tag>
+                    <el-tag v-else-if="scope.row.status === 4" :type="'danger'" disable-transitions>
+                      审核未通过
+                    </el-tag>
+                    <el-tag v-else-if="scope.row.status === 5" :type="'danger'" disable-transitions>
+                      待缓存
+                    </el-tag>
+                    <el-tag v-else-if="scope.row.status === 6" :type="'danger'" disable-transitions>
+                      缓存中
+                    </el-tag>
+                    <el-tag v-else-if="scope.row.status === 7" :type="'danger'" disable-transitions>
+                      缓存失败
+                    </el-tag>
                     <el-tag v-else :type="'danger'" disable-transitions>
                     <el-tag v-else :type="'danger'" disable-transitions>
-                       下架
+                       未知状态
                     </el-tag>
                     </el-tag>
                   </template>
                   </template>
                 </el-table-column>
                 </el-table-column>
-                <el-table-column label="操作" width="210">
+                <el-table-column label="操作" width="210" fixed="right">
                   <template slot-scope="scope">
                   <template slot-scope="scope">
                     <el-button
                     <el-button
                       size="mini"
                       size="mini"
                       @click="handlePreview(scope.$index, scope.row)">预览</el-button>
                       @click="handlePreview(scope.$index, scope.row)">预览</el-button>
+                    <el-button
+                      size="mini"
+                      @click="handleCensor(scope.$index, scope.row)">审核</el-button>
                     <el-button
                     <el-button
                       size="mini"
                       size="mini"
                       @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
                       @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
@@ -396,9 +410,12 @@ export default {
     },
     },
     handleEdit(index, row) {
     handleEdit(index, row) {
       console.log(row.videoId);
       console.log(row.videoId);
-      const path = '/post/edit/video/' + row.videoId
+      const path = '/admin/edit/video/' + row.videoId
       this.$router.push(path)
       this.$router.push(path)
     },
     },
+    handleCensor(index, row) {
+      console.log('审核视频')
+    },
     handleDelete(index, row) {
     handleDelete(index, row) {
       deleteVideo(row.videoId).then(res => {
       deleteVideo(row.videoId).then(res => {
          if (res.code === 0) {
          if (res.code === 0) {

+ 56 - 139
src/views/admin/AdminUser.vue

@@ -27,75 +27,79 @@
               label="注册时间">
               label="注册时间">
             </el-table-column>
             </el-table-column>
             <el-table-column
             <el-table-column
-              prop="coverUrl"
+              prop="avatarUrl"
               label="头像"
               label="头像"
               width="80">
               width="80">
               <template   slot-scope="scope">
               <template   slot-scope="scope">
-                <el-image :src="scope.row.coverUrl" min-width="40" height="30" />
+                <el-image :src="scope.row.avatarUrl" min-width="40" height="30" />
               </template>
               </template>
             </el-table-column>
             </el-table-column>
             <el-table-column
             <el-table-column
-              prop="videoId"
+              prop="userId"
               label="用户 ID">
               label="用户 ID">
               <template slot-scope="scope">
               <template slot-scope="scope">
-                <router-link target="_blank" :to="`/video/${scope.row.videoId}`">
-                  <span>{{scope.row.videoId}}</span>
+                <router-link target="_blank" :to="`/user/${scope.row.userId}`">
+                  <span>{{scope.row.userId}}</span>
                 </router-link>
                 </router-link>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
             <el-table-column
             <el-table-column
-              prop="title"
-              label="用户名">
+              prop="screenName"
+              label="显示名">
             </el-table-column>
             </el-table-column>
             <el-table-column
             <el-table-column
-              prop="description"
+              prop="gender"
+              label="性别">
+            </el-table-column>
+            <el-table-column
+              prop="signature"
               label="签名">
               label="签名">
             </el-table-column>
             </el-table-column>
             <el-table-column
             <el-table-column
-              prop="scope"
-              label="状态">
+              prop="following"
+              label="关注数">
+            </el-table-column>
+            <el-table-column
+              prop="follower"
+              label="粉丝数">
+            </el-table-column>
+            <el-table-column
+              prop="accountType"
+              label="帐号类型">
+              <template slot-scope="scope">
+                <el-tag v-if="scope.row.status === 1" :type="'warning'" disable-transitions>
+                  tnb 帐号
+                </el-tag>
+                <el-tag v-else-if="scope.row.status === 2" :type="'success'" disable-transitions>
+                  bilibili 帐号
+                </el-tag>
+                <el-tag v-else :type="'danger'" disable-transitions>
+                  其他
+                </el-tag>
+              </template>
+            </el-table-column>
+            <el-table-column
+              prop="accountType"
+              label="帐号状态">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-tooltip class="item" effect="dark" content="点击修改视频可见范围" placement="top-end">
                 <el-tooltip class="item" effect="dark" content="点击修改视频可见范围" placement="top-end">
                   <el-button
                   <el-button
                     v-if="scope.row.scope === 1"
                     v-if="scope.row.scope === 1"
                     size="mini"
                     size="mini"
-                    @click="handleScope(scope.$index, scope.row)">所有人可见</el-button>
+                    @click="handleScope(scope.$index, scope.row)">正常</el-button>
                   <el-button
                   <el-button
                     v-else-if="scope.row.scope === 2"
                     v-else-if="scope.row.scope === 2"
                     size="mini"
                     size="mini"
                     type="success"
                     type="success"
-                    @click="handleScope(scope.$index, scope.row)">VIP 可见</el-button>
-                  <el-button
-                    v-else-if="scope.row.scope === 3"
-                    size="mini"
-                    type="warning"
-                    @click="handleScope(scope.$index, scope.row)">验证码可见</el-button>
+                    @click="handleScope(scope.$index, scope.row)">封禁</el-button>
                   <el-button
                   <el-button
                     v-else
                     v-else
                     size="mini"
                     size="mini"
                     type="danger"
                     type="danger"
-                    @click="handleScope(scope.$index, scope.row)">本人可见</el-button>
+                    @click="handleScope(scope.$index, scope.row)">其他</el-button>
                 </el-tooltip>
                 </el-tooltip>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column
-              prop="scope"
-              label="审核状态">
-              <template slot-scope="scope">
-                <el-tag v-if="scope.row.status === 1" :type="'warning'" disable-transitions>
-                  审核中
-                </el-tag>
-                <el-tag v-else-if="scope.row.status === 2" :type="'success'" disable-transitions>
-                  审核通过
-                </el-tag>
-                <el-tag v-else-if="scope.row.status === 3" :type="'danger'" disable-transitions>
-                  审核未通过
-                </el-tag>
-                <el-tag v-else :type="'danger'" disable-transitions>
-                  下架
-                </el-tag>
-              </template>
-            </el-table-column>
             <el-table-column label="操作" width="210">
             <el-table-column label="操作" width="210">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-button
                 <el-button
@@ -118,6 +122,7 @@
           <el-pagination
           <el-pagination
             background
             background
             :small="screenWidth <= 768"
             :small="screenWidth <= 768"
+            hide-on-single-page
             layout="prev, pager, next"
             layout="prev, pager, next"
             :page-size="pageSize"
             :page-size="pageSize"
             :current-page="currentPage"
             :current-page="currentPage"
@@ -139,7 +144,7 @@
     >
     >
       <el-card class="box-card">
       <el-card class="box-card">
         <div slot="header" class="clearfix">
         <div slot="header" class="clearfix">
-          <span>修改视频可见范围</span>
+          <span>修改帐号状态</span>
           <el-button style="float: right; padding: 3px 0" type="text" @click="onUpdateVideoScope">更新</el-button>
           <el-button style="float: right; padding: 3px 0" type="text" @click="onUpdateVideoScope">更新</el-button>
         </div>
         </div>
         <div class="text item">
         <div class="text item">
@@ -156,32 +161,15 @@
         </div>
         </div>
       </el-card>
       </el-card>
     </el-dialog>
     </el-dialog>
-    <!-- 视频预览对话框 -->
-    <el-dialog
-      title="预览视频"
-      append-to-body
-      :visible.sync="showPreviewDialog"
-      :before-close="handleDialogClose"
-      width="70%"
-      center
-    >
-      <template>
-        <video-preview-player :video-prop.sync="this.videoProp"/>
-      </template>
-    </el-dialog>
   </el-row>
   </el-row>
 </template>
 </template>
 
 
 <script>
 <script>
-import VideoPreviewPlayer from 'components/VideoPreviewPlayer'
-
-import {userVideoPost, updateVideoScope, videoInfo, deleteVideo} from "@/api/video";
-import {getUserAlbums} from "@/api/image";
-import { getUserAudio } from "@/api/audio";
+import { getUserList } from "@/api/user";
 
 
 export default {
 export default {
   name: 'AdminPost',
   name: 'AdminPost',
-  components: { VideoPreviewPlayer },
+  components: {},
   data() {
   data() {
     return {
     return {
       // 屏幕宽度, 为了控制分页条的大小
       // 屏幕宽度, 为了控制分页条的大小
@@ -195,9 +183,7 @@ export default {
         { path: '/admin/user', name: '用户', icon: 'el-icon-user' },
         { path: '/admin/user', name: '用户', icon: 'el-icon-user' },
         { path: '/admin/post', name: '稿件', icon: 'el-icon-files' },
         { path: '/admin/post', name: '稿件', icon: 'el-icon-files' },
       ],
       ],
-      userId: 10001,
       showPreviewDialog: false,
       showPreviewDialog: false,
-      videoProp: null,
       showEditScopeDialog: false,
       showEditScopeDialog: false,
       form: {
       form: {
         videoId: null,
         videoId: null,
@@ -207,7 +193,7 @@ export default {
   },
   },
   created() {
   created() {
     document.title = "用户管理"
     document.title = "用户管理"
-    this.getData()
+    this.getUserListWrapper(this.currentPage)
   },
   },
   watch: {
   watch: {
     $route(){
     $route(){
@@ -217,7 +203,7 @@ export default {
   methods: {
   methods: {
     handleCurrentChange(pageNumber) {
     handleCurrentChange(pageNumber) {
       this.currentPage = pageNumber
       this.currentPage = pageNumber
-      this.getData()
+      this.getUserListWrapper(this.currentPage)
       // 回到顶部
       // 回到顶部
       scrollTo(0, 0)
       scrollTo(0, 0)
     },
     },
@@ -226,77 +212,24 @@ export default {
       this.form.scope = row.scope
       this.form.scope = row.scope
       this.showEditScopeDialog = true
       this.showEditScopeDialog = true
     },
     },
-    handleDialogClose(done) {
-      this.showPreviewDialog = false
-      this.videoProp = {
-        videoId: null,
-        play: false
-      }
-      done()
-    },
     handlePreview(index, row) {
     handlePreview(index, row) {
-      videoInfo(row.videoId).then(res => {
-        if (res.code === 0) {
-          this.showPreviewDialog = true
-          this.videoProp = {
-            videoId: res.data.videoId,
-            play: true
-          }
-        }
-      })
-      console.log('预览 ' + row.videoId);
+      console.log('预览操作')
     },
     },
     handleEdit(index, row) {
     handleEdit(index, row) {
-      console.log(row.videoId);
-      const path = '/post/edit/video/' + row.videoId
-      this.$router.push(path)
+      console.log('编辑操作')
     },
     },
     handleDelete(index, row) {
     handleDelete(index, row) {
-      deleteVideo(row.videoId).then(res => {
-         if (res.code === 0) {
-           this.$notify({
-             title: '提示',
-             message: '视频稿件已删除',
-             type: 'warning',
-             duration: 3000
-           })
-           this.$router.go(0)
-         }
-      })
-    },
-    handleEditImage(index, row) {
-      console.log(row.videoId);
-      const path = '/post/edit/album/' + row.albumId
-      this.$router.push(path)
-    },
-    handleDeleteImage(index, row) {
-      console.log(row.videoId);
+      console.log('删除操作')
     },
     },
-    handleEditAudio(index, row) {
-      console.log(row.videoId);
-      const path = '/post/edit/audio/' + row.audioId
-      this.$router.push(path)
-    },
-    handleDeleteAudio(index, row) {
-      console.log(row.videoId);
-    },
-    getData() {
-      this.dataList = []
-      userVideoPost(this.currentPage).then(res => {
+    getUserListWrapper(page) {
+      getUserList(page).then(res => {
         if (res.code === 0) {
         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
-          }
+          this.dataList = res.data.list
+          this.totalSize = res.data.totalSize
         } else {
         } else {
           this.$notify({
           this.$notify({
             title: '提示',
             title: '提示',
-            message: res.msg,
+            message: '获取用户列表失败',
             type: 'warning',
             type: 'warning',
             duration: 3000
             duration: 3000
           })
           })
@@ -305,30 +238,14 @@ export default {
         this.$notify({
         this.$notify({
           title: '提示',
           title: '提示',
           message: error.message,
           message: error.message,
-          type: 'error',
+          type: 'warning',
           duration: 3000
           duration: 3000
         })
         })
       })
       })
     },
     },
     onUpdateVideoScope() {
     onUpdateVideoScope() {
       this.showEditScopeDialog = false
       this.showEditScopeDialog = false
-      updateVideoScope(this.form).then(res => {
-        if (res.code === 0) {
-          this.$notify({
-            title: '提示',
-            message: '视频可见范围已更新',
-            type: 'warning',
-            duration: 3000
-          })
-        }
-      }).catch(error => {
-        this.$notify({
-          title: '提示',
-          message: error.message,
-          type: 'warning',
-          duration: 3000
-        })
-      })
+      console.log('更新帐号状态')
     }
     }
   }
   }
 }
 }