Explorar o código

只有 BiliVideo 才显示缓存按钮

reghao %!s(int64=2) %!d(string=hai) anos
pai
achega
9e34fe0e31
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      src/views/home/VideoPage.vue

+ 4 - 2
src/views/home/VideoPage.vue

@@ -60,12 +60,13 @@
                 <span>下载</span>
               </el-button>
               <el-button
+                v-if="video.cache != null"
                 type="danger"
                 size="mini"
                 icon="el-icon-download"
                 @click="cacheBiliVideo(video.videoId)"
               >
-                <span>缓存</span>
+                <span>{{video.cache.msg}}</span>
               </el-button>
               <el-button
                 type="danger"
@@ -371,9 +372,10 @@ export default {
     cacheBiliVideo(bvId) {
       cacheBiliVideo(bvId).then(res => {
         if (res.code === 0) {
+          const resData = res.data
           this.$notify({
             title: '提示',
-            message: 'bili 视频正在缓存中',
+            message: resData.msg,
             type: 'warning',
             duration: 3000
           })