From 41fa6526c0b19e0f42bce2ea4c395bd13122b893 Mon Sep 17 00:00:00 2001
From: sk1551 <15175617877@163.com>
Date: Sat, 30 Jan 2021 09:04:39 +0800
Subject: [PATCH] =?UTF-8?q?Merge=20branch=20'master'=20of=20D:\=E6=92=AD?=
 =?UTF-8?q?=E6=99=BA=E6=95=99=E8=82=B2\2020\benyi=20with=20conflicts.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
 .idea/encodings.xml                           |   4 +-
 .idea/workspace.xml                           | 504 +++++++++++++++++-
 ruoyi-ui/src/utils/zipdownload.js             | 106 ++--
 .../views/benyi_train/video_study/index.vue   |  12 +-
 .../system/controller/SysLoginController.java |   3 +
 5 files changed, 562 insertions(+), 67 deletions(-)
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
index 15a15b218..3f9ba7708 100644
--- a/.idea/encodings.xml
+++ b/.idea/encodings.xml
@@ -1,4 +1,6 @@
 
 
-  
+  
+    
+  
 
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index bb2310ead..e91e8a781 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,39 +1,300 @@
 
 
   
-    
+
+      
+      
+      
+      
+      
+    
+    
+    
+    
     
     
     
     
   
+  
+    
+      
+        
+          
+            
+              
+            
+          
+        
+      
+      
+        
+          
+            
+              
+            
+          
+        
+      
+    
+  
+  
+    
+      checkUserNameUnique
+      222222222222222222222
+      111111111111111111
+    
+  
   
     
   
+  
+    
+  
+  
+    
+      
+        
++
+        
+        
+
+
+
+        
+      
+      
+    
+  
   
-    
-    
-    
-    
+    
+    
+    
+    
   
   
-  
+  
+    
+  
+  
+    
+      
+    
+    
+      
+      
+      
+        
+          
+            
+
+
+            
+            
+
+
+
+            
+            
+
+
+
+
+            
+            
+
+
+
+
+
+            
+            
+
+
+
+
+
+
+            
+            
+
+
+
+
+
+
+
+            
+            
+
+
+
+
+
+
+
+
+            
+            
+
+
+
+
+
+
+
+
+
+            
+            
+
+
+
+
+
+
+
+
+            
+            
+
+
+
+
+
+
+
+
+
+            
+            
+
+
+
+
+
+
+
+
+
+
+            
+            
+
+
+
+
+
+
+
+
+
+            
+            
+
+
+
+
+
+
+
+
+
+            
+            
+
+
+
+
+
+
+
+
+
+
+            
+            
+
+
+
+
+
+
+            
+            
+
+
+
+
+
+
+
+            
+            
+
+
+
+
+            
+          
+          
+        
+      
+    
+  
   
     
     
   
   
+    
+    
+    
+    
     
     
     
     
-    
-    
+    
+    
+    
+    
+    
+    
     
     
     
+    
     
   
+  
+    
+
+        
+          
+        
+        
+          
+        
+      
+    
+  
+  
+    
+      
+      
+      
+        
+      
+    
+  
   
     
   
@@ -49,11 +310,236 @@
       
       
       
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
     
+    
+      1610933089622
+      
+      
+      
+      1610933089622
+    
+    
+      1611718556459
+      
+      
+      
+      1611718556459
+    
+    
+      1611823412772
+      
+      
+      
+      1611823412772
+    
+    
+      1611895251217
+      
+      
+      
+      1611895251217
+    
+    
+      1611899191826
+      
+      
+      
+      1611899191826
+    
+    
     
   
+  
+    
+  
+  
+    
+    
+    
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+    
+  
   
-    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      
+    
+    
+      
+        
+          
+        
+      
+    
+    
+      
+        
+          
+        
+      
+    
+    
+      
+    
+    
+      
+        
+      
+    
+    
+      
+        
+          
+        
+      
+    
+    
+      
+        
+          
+          
+            
+            
+          
+        
+      
+    
+    
+      
+        
+          
+          
+            
+            
+          
+        
+      
+    
+    
+      
+        
+          
+        
+      
+    
+    
+      
+        
+          
+        
+      
+    
+    
+      
+        
+          
+        
+      
+    
+    
+      
+        
+          
+        
+      
+    
+    
+      
+        
+          
+        
+      
+    
+    
+      
+        
+          
+        
+      
+    
+    
+      
+        
+          
+        
+      
+    
+    
+      
+        
+          
+        
+      
+    
+    
+      
+        
+          
+        
+      
+    
   
   
     
diff --git a/ruoyi-ui/src/utils/zipdownload.js b/ruoyi-ui/src/utils/zipdownload.js
index 666d2af77..ea04a0227 100644
--- a/ruoyi-ui/src/utils/zipdownload.js
+++ b/ruoyi-ui/src/utils/zipdownload.js
@@ -2,59 +2,57 @@ import axios from 'axios'
 import { getToken } from '@/utils/auth'
 
 const mimeMap = {
-  xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
-  zip: 'application/zip'
+    xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+    zip: 'application/zip'
 }
 
 const baseUrl = process.env.VUE_APP_BASE_API
 export function downLoadZip(str, filename) {
-  var url = baseUrl + str
-  axios({
-    method: 'get',
-    url: url,
-    responseType: 'blob',
-    headers: { 'Authorization': 'Bearer ' + getToken() }
-  }).then(res => {
-    resolveBlob(res, mimeMap.zip)
-  })
+    var url = baseUrl + str
+    axios({
+        method: 'get',
+        url: url,
+        responseType: 'blob',
+        headers: { 'Authorization': 'Bearer ' + getToken() }
+    }).then(res => {
+        resolveBlob(res, mimeMap.zip)
+    })
 }
 export function downLoadVideoUrl(str) {
-  var url = baseUrl + str
-  axios({
-    method: 'get',
-    url: url,
-    responseType: 'arraybuffer',
-    headers: { 'Authorization': 'Bearer ' + getToken() },
-  }).then(res => {
-    // console.log(res);
-    return res.data
-  })
+    var url = baseUrl + str
+    return axios({
+        method: 'get',
+        url: url,
+        responseType: 'blob',
+        headers: { 'Authorization': 'Bearer ' + getToken() },
+    })
 }
 
 export function downLoadUrl(str, item) {
-  var url = baseUrl + str
-  axios({
-    method: 'get',
-    url: url,
-    responseType: 'blob',
-    headers: { 'Authorization': 'Bearer ' + getToken() },
-  }).then(res => {
-    // console.log(res);
-    downloadFileFun(res.data, item)
-  })
+    var url = baseUrl + str
+    axios({
+        method: 'get',
+        url: url,
+        responseType: 'blob',
+        headers: { 'Authorization': 'Bearer ' + getToken() },
+    }).then(res => {
+        // console.log(res);
+        // downloadFileFun(res.data, item)
+        res.send();
+    })
 }
 
 export function downloadFileFun(data, item) {
-  if (!data) {
-    return
-  }
-  let url = window.URL.createObjectURL(new Blob([data]))
-  let link = document.createElement('a')
-  link.style.display = 'none'
-  link.href = url
-  link.setAttribute('download', item.name)
-  document.body.appendChild(link)
-  link.click()
+    if (!data) {
+        return
+    }
+    let url = window.URL.createObjectURL(new Blob([data]))
+    let link = document.createElement('a')
+    link.style.display = 'none'
+    link.href = url
+    link.setAttribute('download', item.name)
+    document.body.appendChild(link)
+    link.click()
 }
 
 /**
@@ -63,17 +61,17 @@ export function downloadFileFun(data, item) {
  * @param {String} mimeType MIME类型
  */
 export function resolveBlob(res, mimeType) {
-  const aLink = document.createElement('a')
-  var blob = new Blob([res.data], { type: mimeType })
-  // //从response的headers中获取filename, 后端response.setHeader("Content-disposition", "attachment; filename=xxxx.docx") 设置的文件名;
-  var patt = new RegExp('filename=([^;]+\\.[^\\.;]+);*')
-  var contentDisposition = decodeURI(res.headers['content-disposition'])
-  var result = patt.exec(contentDisposition)
-  var fileName = result[1]
-  fileName = fileName.replace(/\"/g, '')
-  aLink.href = URL.createObjectURL(blob)
-  aLink.setAttribute('download', fileName) // 设置下载文件名称
-  document.body.appendChild(aLink)
-  aLink.click()
-  document.body.appendChild(aLink)
+    const aLink = document.createElement('a')
+    var blob = new Blob([res.data], { type: mimeType })
+        // //从response的headers中获取filename, 后端response.setHeader("Content-disposition", "attachment; filename=xxxx.docx") 设置的文件名;
+    var patt = new RegExp('filename=([^;]+\\.[^\\.;]+);*')
+    var contentDisposition = decodeURI(res.headers['content-disposition'])
+    var result = patt.exec(contentDisposition)
+    var fileName = result[1]
+    fileName = fileName.replace(/\"/g, '')
+    aLink.href = URL.createObjectURL(blob)
+    aLink.setAttribute('download', fileName) // 设置下载文件名称
+    document.body.appendChild(aLink)
+    aLink.click()
+    document.body.appendChild(aLink)
 }
\ No newline at end of file
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 d9fa49eb9..4a1f5f34a 100644
--- a/ruoyi-ui/src/views/benyi_train/video_study/index.vue
+++ b/ruoyi-ui/src/views/benyi_train/video_study/index.vue
@@ -171,11 +171,17 @@ export default {
       return data;
     },
     /** 查询培训列表 */
-    getList() {
+   async 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,
@@ -186,8 +192,8 @@ export default {
               {
                 type: ele.filetype,
                 // mp4
-                src: ele.videourl
-                // src: downLoadVideoUrl(ele.videourl),
+                // src: ele.videourl
+                src: videobuffer.request.response,
               },
             ],
             notSupportedMessage: "此视频暂无法播放,请稍后再试",
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysLoginController.java b/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysLoginController.java
index e2fc9ffeb..72dcf7a9c 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysLoginController.java
+++ b/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysLoginController.java
@@ -4,6 +4,8 @@ import java.util.List;
 import java.util.Set;
 
 import com.ruoyi.framework.redis.RedisCache;
+import com.ruoyi.project.system.domain.BySchool;
+import com.ruoyi.project.system.service.IBySchoolService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -92,6 +94,7 @@ public class SysLoginController
         Set roles = permissionService.getRolePermission(user);
         // 权限集合
         Set permissions = permissionService.getMenuPermission(user);
+
         AjaxResult ajax = AjaxResult.success();
         ajax.put("user", user);
         ajax.put("roles", roles);