From 128fb0dd4f2324c13c0c277e347e1384c17d99b7 Mon Sep 17 00:00:00 2001 From: sk1551 <15175617877@163.com> Date: Sat, 30 Jan 2021 09:11:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/utils/zipdownload.js | 10 ++++++---- ruoyi-ui/src/views/benyi_train/video_study/index.vue | 12 +++--------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/ruoyi-ui/src/utils/zipdownload.js b/ruoyi-ui/src/utils/zipdownload.js index ea04a0227..92714b819 100644 --- a/ruoyi-ui/src/utils/zipdownload.js +++ b/ruoyi-ui/src/utils/zipdownload.js @@ -20,11 +20,14 @@ export function downLoadZip(str, filename) { } export function downLoadVideoUrl(str) { var url = baseUrl + str - return axios({ + axios({ method: 'get', url: url, - responseType: 'blob', + responseType: 'arraybuffer', headers: { 'Authorization': 'Bearer ' + getToken() }, + }).then(res => { + // console.log(res); + return res.data }) } @@ -37,8 +40,7 @@ export function downLoadUrl(str, item) { headers: { 'Authorization': 'Bearer ' + getToken() }, }).then(res => { // console.log(res); - // downloadFileFun(res.data, item) - res.send(); + downloadFileFun(res.data, item) }) } diff --git a/ruoyi-ui/src/views/benyi_train/video_study/index.vue b/ruoyi-ui/src/views/benyi_train/video_study/index.vue index 4a1f5f34a..d9fa49eb9 100644 --- a/ruoyi-ui/src/views/benyi_train/video_study/index.vue +++ b/ruoyi-ui/src/views/benyi_train/video_study/index.vue @@ -171,17 +171,11 @@ export default { return data; }, /** 查询培训列表 */ - async getList() { + getList() { this.loading = true; - let videobuffer=""; - await downLoadVideoUrl("/profile/video/lg4y3idmDCEme_eu6FzAAoOdcyS2.mp4").then((res)=>{ - videobuffer=res; - console.log(videobuffer); - }) listVideo(this.queryParams).then((response) => { this.videoList = response.rows; this.playerOptions = response.rows.map((ele) => { - console.log(ele.videourl); return { autoplay: false, muted: true, @@ -192,8 +186,8 @@ export default { { type: ele.filetype, // mp4 - // src: ele.videourl - src: videobuffer.request.response, + src: ele.videourl + // src: downLoadVideoUrl(ele.videourl), }, ], notSupportedMessage: "此视频暂无法播放,请稍后再试",