From 94554d0e7b2bfa4348dbddced9e23b90830ade9c Mon Sep 17 00:00:00 2001 From: zch Date: Thu, 14 Nov 2024 13:47:03 +0800 Subject: [PATCH] =?UTF-8?q?change(record):=20=E4=BC=98=E5=8C=96=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E6=92=AD=E6=94=BE=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除 index.vue 中的系统介绍和主要特点内容 - 增加接口注释 - 更新 VideoPlayer.vue 中的视频播放器实现,增加跨域支持 --- .../controller/RecordInspectionCabinetController.java | 8 ++++++-- ruoyi-ui/src/views/index.vue | 11 ++--------- .../record/recordInspectionCabinet/VideoPlayer.vue | 7 +++++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ruoyi-module/src/main/java/com/ruoyi/record/controller/RecordInspectionCabinetController.java b/ruoyi-module/src/main/java/com/ruoyi/record/controller/RecordInspectionCabinetController.java index 16d505e..a8a05b1 100644 --- a/ruoyi-module/src/main/java/com/ruoyi/record/controller/RecordInspectionCabinetController.java +++ b/ruoyi-module/src/main/java/com/ruoyi/record/controller/RecordInspectionCabinetController.java @@ -140,7 +140,9 @@ public class RecordInspectionCabinetController extends BaseController FileSystemResource resource = new FileSystemResource(file); // 设置响应头,指定内容类型为视频格式 HttpHeaders headers = new HttpHeaders(); + // 设置文件长度的内容类型 headers.setContentLength(file.length()); + // 解析媒体类型并设置内容类型为视频MP4 headers.setContentType(MediaType.parseMediaType("video/mp4")); // 返回包含文件资源的响应实体 return ResponseEntity.ok() @@ -169,10 +171,12 @@ public class RecordInspectionCabinetController extends BaseController if (file.exists()) { // 如果文件存在,创建文件系统资源对象 FileSystemResource resource = new FileSystemResource(file); - // 设置HTTP头信息,指定内容类型为视频格式 + // 设置HTTP头信息 HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.parseMediaType("video/mp4")); + // 设置文件长度 headers.setContentLength(file.length()); + // 解析媒体类型并设置内容类型为视频MP4 + headers.setContentType(MediaType.parseMediaType("video/mp4")); // 返回包含文件资源的响应实体 return ResponseEntity.ok() .headers(headers) diff --git a/ruoyi-ui/src/views/index.vue b/ruoyi-ui/src/views/index.vue index 0234cc7..4fac118 100644 --- a/ruoyi-ui/src/views/index.vue +++ b/ruoyi-ui/src/views/index.vue @@ -5,18 +5,11 @@
-

系统介绍

-

这是一个赛轮智慧热电管理系统,提供了丰富的功能和优雅的界面。

+
-

主要特点

-
    -
  • 响应式设计
  • -
  • 模块化开发
  • -
  • 高性能
  • -
  • 易扩展
  • -
+
diff --git a/ruoyi-ui/src/views/record/recordInspectionCabinet/VideoPlayer.vue b/ruoyi-ui/src/views/record/recordInspectionCabinet/VideoPlayer.vue index bb3329e..0c04e47 100644 --- a/ruoyi-ui/src/views/record/recordInspectionCabinet/VideoPlayer.vue +++ b/ruoyi-ui/src/views/record/recordInspectionCabinet/VideoPlayer.vue @@ -101,10 +101,13 @@ video {