reghao 1 éve
szülő
commit
b6f591537f

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

@@ -72,25 +72,13 @@ export default {
   data() {
     return {
       // ****************************************************************************************************************
-      options: {
-        target: process.env.VUE_APP_OSS_URL,
-        chunkSize: 1024 * 1024 * 1024, // 1GiB
-        fileParameterName: 'file',
-        testChunks: false,
-        query: (file, chunk) => {
-          return {
-            channelId: 3
-          }
-        },
-        headers: {
-          Authorization: ''
-        }
-      },
+      options: null,
       attrs: {
         accept: 'audio/*'
       },
       // ****************************************************************************************************************
       form: {
+        channelId: process.env.VUE_APP_UPLOAD_AUDIO_CHANNEL,
         audioFileId: null,
         audioUrl: null,
         title: null,
@@ -101,12 +89,24 @@ export default {
     }
   },
   created() {
-    getServerInfo(3).then(res => {
+    getServerInfo(this.form.channelId).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
+        this.options = {
+          target: resData.ossUrl,
+          chunkSize: resData.maxSize,
+          fileParameterName: 'file',
+          testChunks: false,
+          query: (file, chunk) => {
+            return {
+              channelId: this.form.channelId
+            }
+          },
+          headers: {
+            Authorization: 'Bearer ' + resData.token
+          },
+          withCredentials: false
+        }
       } else {
         this.$notify({
           title: '提示',

+ 47 - 54
src/views/cam/Cam.vue

@@ -1,51 +1,53 @@
 <template>
-  <el-container style="height: 800px; border: 1px solid #eee">
+  <el-container style="height: 650px; 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-row>
+        <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-col :md="20">
+          <el-menu
+            :default-active="this.$route.path"
+            router
+            mode="horizontal"
+          >
+            <el-menu-item index="/cam/list">
+              <template slot="title" class="el-icon-camera">摄像头</template>
+            </el-menu-item>
+          </el-menu>
+        </el-col>
+        <el-col :md="2">
+          <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-col>
+      </el-row>
     </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-menu-item index="/cam/list">
-            <i class="el-icon-camera" />
-            <span slot="title">摄像头列表</span>
-          </el-menu-item>
-        </el-menu>
-      </el-aside>
       <el-main>
         <router-view />
       </el-main>
@@ -67,7 +69,7 @@ export default {
     }
   },
   created() {
-    document.title = '我的摄像头'
+    document.title = '我的监控'
     const userInfo = getAuthedUser()
     if (userInfo !== null) {
       this.user = userInfo
@@ -78,13 +80,4 @@ export default {
 </script>
 
 <style>
-.el-header {
-  background-color: #B3C0D1;
-  color: #333;
-  line-height: 60px;
-}
-
-.el-aside {
-  color: #333;
-}
 </style>

+ 164 - 148
src/views/cam/CamList.vue

@@ -1,155 +1,157 @@
 <template>
-  <el-row>
-    <el-row>
-      <el-button
-        size="mini"
-        type="warning"
-        class="el-icon-document-add"
-        @click="handleAdd"
-      >添加</el-button>
-      <el-table
-        :data="dataList"
-        style="width: 100%"
-      >
-        <el-table-column
-          label="No"
-          type="index"
-        />
-        <el-table-column
-          prop="addAt"
-          label="添加时间"
-          width="150"
-        />
-        <el-table-column
-          prop="camName"
-          label="摄像头名字"
-          width="150"
+  <el-row class="movie-list">
+    <el-col :md="18">
+      <el-row>
+        <el-button
+          size="mini"
+          type="warning"
+          class="el-icon-document-add"
+          @click="handleAdd"
+        >添加</el-button>
+        <el-table
+          :data="dataList"
+          style="width: 100%"
         >
-          <template slot-scope="scope">
-            <router-link style="text-decoration-line: none" target="_blank" :to="`/cam/live/${scope.row.camId}`">
-              {{ scope.row.camName }}
-            </router-link>
-          </template>
-        </el-table-column>
-        <el-table-column
-          prop="state"
-          label="状态"
+          <el-table-column
+            label="No"
+            type="index"
+          />
+          <el-table-column
+            prop="addAt"
+            label="添加时间"
+            width="150"
+          />
+          <el-table-column
+            prop="camName"
+            label="摄像头名字"
+            width="150"
+          >
+            <template slot-scope="scope">
+              <router-link style="text-decoration-line: none" target="_blank" :to="`/cam/live/${scope.row.camId}`">
+                {{ scope.row.camName }}
+              </router-link>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="state"
+            label="状态"
+          >
+            <template slot-scope="scope">
+              <el-tag v-if="scope.row.state" :type="'success'" disable-transitions>
+                推流中
+              </el-tag>
+              <el-tag v-else :type="'danger'" disable-transitions>
+                离线
+              </el-tag>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="操作"
+          >
+            <template slot-scope="scope">
+              <el-button
+                size="mini"
+                type="success"
+                @click="goToCamRecord(scope.row)"
+              >历史录像</el-button>
+              <el-button
+                size="mini"
+                @click="handleEdit(scope.$index, scope.row)"
+              >修改名字</el-button>
+              <el-button
+                size="mini"
+                @click="handleDetail(scope.$index, scope.row)"
+              >推流地址</el-button>
+              <el-button
+                size="mini"
+                type="danger"
+                @click="handleDelete(scope.$index, scope.row)"
+              >删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+        <!-- 添加摄像头对话框 -->
+        <el-dialog
+          append-to-body
+          :visible.sync="showEditScopeDialog"
+          width="50%"
+          center
         >
-          <template slot-scope="scope">
-            <el-tag v-if="scope.row.state" :type="'success'" disable-transitions>
-              推流中
-            </el-tag>
-            <el-tag v-else :type="'danger'" disable-transitions>
-              离线
-            </el-tag>
-          </template>
-        </el-table-column>
-        <el-table-column
-          label="操作"
+          <el-card class="box-card">
+            <div slot="header" class="clearfix">
+              <h3>添加摄像头</h3>
+            </div>
+            <div class="text item">
+              <el-form ref="form" :model="addCamForm" label-width="80px">
+                <el-form-item label="设备 ID">
+                  <el-input v-model="addCamForm.deviceId" />
+                </el-form-item>
+                <el-form-item label="设备名字">
+                  <el-input v-model="addCamForm.deviceName" />
+                </el-form-item>
+                <el-form-item>
+                  <el-button type="primary" @click="onAddCam">立即添加</el-button>
+                  <el-button>取消</el-button>
+                </el-form-item>
+              </el-form>
+            </div>
+          </el-card>
+        </el-dialog>
+        <!-- 修改摄像头名字对话框 -->
+        <el-dialog
+          append-to-body
+          :visible.sync="showUpdateDialog"
+          width="50%"
+          center
         >
-          <template slot-scope="scope">
-            <el-button
-              size="mini"
-              type="success"
-              @click="goToCamRecord(scope.row)"
-            >历史录像</el-button>
-            <el-button
-              size="mini"
-              @click="handleEdit(scope.$index, scope.row)"
-            >修改名字</el-button>
-            <el-button
-              size="mini"
-              @click="handleDetail(scope.$index, scope.row)"
-            >推流地址</el-button>
-            <el-button
-              size="mini"
-              type="danger"
-              @click="handleDelete(scope.$index, scope.row)"
-            >删除</el-button>
-          </template>
-        </el-table-column>
-      </el-table>
-      <!-- 添加摄像头对话框 -->
-      <el-dialog
-        append-to-body
-        :visible.sync="showEditScopeDialog"
-        width="50%"
-        center
-      >
-        <el-card class="box-card">
-          <div slot="header" class="clearfix">
-            <h3>添加摄像头</h3>
-          </div>
-          <div class="text item">
-            <el-form ref="form" :model="addCamForm" label-width="80px">
-              <el-form-item label="设备 ID">
-                <el-input v-model="addCamForm.deviceId" />
-              </el-form-item>
-              <el-form-item label="设备名字">
-                <el-input v-model="addCamForm.deviceName" />
-              </el-form-item>
-              <el-form-item>
-                <el-button type="primary" @click="onAddCam">立即添加</el-button>
-                <el-button>取消</el-button>
-              </el-form-item>
-            </el-form>
-          </div>
-        </el-card>
-      </el-dialog>
-      <!-- 修改摄像头名字对话框 -->
-      <el-dialog
-        append-to-body
-        :visible.sync="showUpdateDialog"
-        width="50%"
-        center
-      >
-        <el-card class="box-card">
-          <div slot="header" class="clearfix">
-            <h3>修改摄像头名字</h3>
-          </div>
-          <div class="text item">
-            <el-form ref="form" :model="updateNameForm" label-width="80px">
-              <el-form-item label="新名字">
-                <el-input v-model="updateNameForm.newName" />
-              </el-form-item>
-              <el-form-item>
-                <el-button type="primary" @click="onUpdateCam">立即修改</el-button>
-                <el-button>取消</el-button>
-              </el-form-item>
-            </el-form>
-          </div>
-        </el-card>
-      </el-dialog>
-      <!-- 摄像头详情对话框 -->
-      <el-dialog
-        append-to-body
-        :visible.sync="showDetailDialog"
-        width="50%"
-        center
-      >
-        <el-card class="box-card">
-          <div slot="header" class="clearfix">
-            <h3>推流地址</h3>
-          </div>
-          <div class="text item">
-            <h3>{{ pushUrl }}</h3>
-          </div>
-        </el-card>
-      </el-dialog>
-    </el-row>
-    <el-row>
-      <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-row>
+          <el-card class="box-card">
+            <div slot="header" class="clearfix">
+              <h3>修改摄像头名字</h3>
+            </div>
+            <div class="text item">
+              <el-form ref="form" :model="updateNameForm" label-width="80px">
+                <el-form-item label="新名字">
+                  <el-input v-model="updateNameForm.newName" />
+                </el-form-item>
+                <el-form-item>
+                  <el-button type="primary" @click="onUpdateCam">立即修改</el-button>
+                  <el-button>取消</el-button>
+                </el-form-item>
+              </el-form>
+            </div>
+          </el-card>
+        </el-dialog>
+        <!-- 摄像头详情对话框 -->
+        <el-dialog
+          append-to-body
+          :visible.sync="showDetailDialog"
+          width="50%"
+          center
+        >
+          <el-card class="box-card">
+            <div slot="header" class="clearfix">
+              <h3>推流地址</h3>
+            </div>
+            <div class="text item">
+              <h3>{{ pushUrl }}</h3>
+            </div>
+          </el-card>
+        </el-dialog>
+      </el-row>
+      <el-row>
+        <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-row>
+    </el-col>
   </el-row>
 </template>
 
@@ -323,4 +325,18 @@ export default {
 </script>
 
 <style>
+/*处于手机屏幕时*/
+@media screen and (max-width: 768px) {
+  .movie-list {
+    padding-top: 8px;
+    padding-left: 0.5%;
+    padding-right: 0.5%;
+  }
+}
+
+.movie-list {
+  padding-top: 15px;
+  padding-left: 6%;
+  padding-right: 6%;
+}
 </style>

+ 6 - 6
src/views/mall/Mall.vue

@@ -19,22 +19,22 @@
             mode="horizontal"
           >
             <el-submenu index="/mall/my">
-              <template class="el-icon-user" slot="title">我的宝淘</template>
+              <template slot="title" class="el-icon-user">我的宝淘</template>
               <el-menu-item index="/mall/order">
-                <template class="el-icon-s-order" slot="title">我的订单</template>
+                <template slot="title" class="el-icon-s-order">我的订单</template>
               </el-menu-item>
               <el-menu-item index="/mall/visit">
-                <template class="el-icon-shopping-cart-full" slot="title">浏览记录</template>
+                <template slot="title" class="el-icon-shopping-cart-full">浏览记录</template>
               </el-menu-item>
             </el-submenu>
             <el-menu-item index="/mall/cart">
               <template slot="title">
                 <span>购物车</span>
-                <el-badge class="item" :value="cartCount" :max="99"></el-badge>
+                <el-badge class="item" :value="cartCount" :max="99" />
               </template>
             </el-menu-item>
             <el-menu-item index="/mall/fav">
-              <template class="el-icon-collection" slot="title">收藏夹</template>
+              <template slot="title" class="el-icon-collection">收藏夹</template>
             </el-menu-item>
           </el-menu>
         </el-col>
@@ -73,7 +73,7 @@
 <script>
 import { userMixin } from 'assets/js/mixin'
 import { getAuthedUser } from '@/utils/auth'
-import {getCartItems} from "@/api/mall";
+import { getCartItems } from '@/api/mall'
 
 export default {
   name: 'Mall',

+ 16 - 16
src/views/mall/Product.vue

@@ -5,36 +5,36 @@
     </el-col>
     <el-col :md="12">
       <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
-        <h1>{{product.title}}</h1>
-        <span>已售 {{product.monthSale}}</span>
-        <h2 style="color: red">¥{{product.price}}</h2>
+        <h1>{{ product.title }}</h1>
+        <span>已售 {{ product.monthSale }}</span>
+        <h2 style="color: red">¥{{ product.price }}</h2>
       </el-row>
       <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
-        <span>配送: {{product.from}} 至 {{to}} </span>
+        <span>配送: {{ product.from }} 至 {{ to }} </span>
       </el-row>
       <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
         <span>分类: </span>
         <el-radio-group v-model="radio1" @change="onClick">
-          <el-radio-button label="上海"></el-radio-button>
-          <el-radio-button label="北京"></el-radio-button>
-          <el-radio-button label="广州"></el-radio-button>
-          <el-radio-button label="深圳"></el-radio-button>
+          <el-radio-button label="上海" />
+          <el-radio-button label="北京" />
+          <el-radio-button label="广州" />
+          <el-radio-button label="深圳" />
         </el-radio-group>
       </el-row>
       <el-form style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
         <el-form-item>
-          <el-input-number v-model="num" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
+          <el-input-number v-model="num" :min="1" :max="10" label="描述文字" @change="handleChange" />
         </el-form-item>
         <el-button round type="danger" @click="buy">立即购买</el-button>
         <el-button round type="danger" @click="addCart">加入购物车</el-button>
       </el-form>
     </el-col>
-    <el-divider/>
+    <el-divider />
   </el-row>
 </template>
 
 <script>
-import {addCart, getProduct} from "@/api/mall";
+import { addCart, getProduct } from '@/api/mall'
 
 export default {
   name: 'Product',
@@ -52,11 +52,11 @@ export default {
   created() {
     const itemId = this.$route.query.id
     if (itemId === undefined) {
-      this.$message("没有 item id")
+      this.$message('没有 item id')
       return
     } else if (itemId === '') {
-      this.$message("item id 为空")
-      return;
+      this.$message('item id 为空')
+      return
     }
 
     this.getData(itemId)
@@ -72,7 +72,7 @@ export default {
       })
     },
     handleChange(value) {
-      console.log(value);
+      console.log(value)
     },
     onClick(value) {
       console.log(value)
@@ -92,7 +92,7 @@ export default {
       jsonData.num = 1
       addCart(jsonData).then(resp => {
         if (resp.code === 0) {
-          this.$message("已添加到购物车")
+          this.$message('已添加到购物车')
         }
       })
     }

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

@@ -17,7 +17,7 @@
           @click="removeFavlist"
         >删除收藏夹</el-button>
       </el-col>
-      <el-col v-for="(item,index) in dataList" :key="index" :md="6" :sm="8" :xs="12">
+      <el-col v-for="(item,index) in dataList" :key="index" :md="6" :sm="8" :xs="12" style="padding-right: 7px; padding-left: 7px">
         <div>
           <el-card :body-style="{ padding: '0px' }" class="card">
             <div class="imgs">

+ 3 - 0
src/views/user/Home.vue

@@ -29,6 +29,9 @@
                 >
                   <span>发消息</span>
                 </el-button>
+                <el-tag v-if="user.biliUserId !== undefined && user.biliUserId !== null" size="mini" type="'success'" disable-transitions>
+                  <a target="_blank" :href="`https://space.bilibili.com/` + user.biliUserId">bili</a>
+                </el-tag>
               </el-col>
               <el-col :md="1">
                 <StampBadge