From b62c7fe18cf2237939a249bae0cc3557e20805c2 Mon Sep 17 00:00:00 2001 From: zch Date: Wed, 20 Nov 2024 09:27:34 +0800 Subject: [PATCH] =?UTF-8?q?change(record):=20=E4=BC=98=E5=8C=96=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=A8=A1=E5=9D=97=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改"是否表示"为"是否标识",统一 terminology - 优化文件下载相关代码,明确 FileSystemResource 的使用原因 --- .../record/controller/RecordBusbarTempController.java | 4 ++-- .../controller/RecordInspectionCabinetController.java | 4 ++-- .../src/views/record/recordInspectionCabinet/index.vue | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ruoyi-module/src/main/java/com/ruoyi/record/controller/RecordBusbarTempController.java b/ruoyi-module/src/main/java/com/ruoyi/record/controller/RecordBusbarTempController.java index 9328fdb..e69ce2f 100644 --- a/ruoyi-module/src/main/java/com/ruoyi/record/controller/RecordBusbarTempController.java +++ b/ruoyi-module/src/main/java/com/ruoyi/record/controller/RecordBusbarTempController.java @@ -127,7 +127,7 @@ public class RecordBusbarTempController extends BaseController File file = new File(fileUrl); // 检查文件是否存在 if (file.exists()) { - // 将文件包装成FileSystemResource对象 + // 创建文件系统资源对象,包装文件,http头不能使用file,所以使用FileSystemResource FileSystemResource resource = new FileSystemResource(file); // 创建HttpHeaders对象,用于设置响应头 HttpHeaders headers = new HttpHeaders(); @@ -173,7 +173,7 @@ public class RecordBusbarTempController extends BaseController File file = new File(fileUrl); // 检查文件是否存在 if (file.exists()) { - // 创建文件系统资源对象 + // 创建文件系统资源对象,包装文件,http头不能使用file,所以使用FileSystemResource FileSystemResource resource = new FileSystemResource(file); // 创建HTTP头对象 HttpHeaders headers = new HttpHeaders(); 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 5e04899..ec0f237 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 @@ -137,7 +137,7 @@ public class RecordInspectionCabinetController extends BaseController File file = new File(fileUrl); // 检查文件是否存在 if (file.exists()) { - // 如果文件存在,创建文件系统资源对象 + // 创建文件系统资源对象,包装文件,http头不能使用file,所以使用FileSystemResource FileSystemResource resource = new FileSystemResource(file); // 设置响应头,指定内容类型为视频格式 HttpHeaders headers = new HttpHeaders(); @@ -179,7 +179,7 @@ public class RecordInspectionCabinetController extends BaseController File file = new File(fileUrl); // 检查文件是否存在 if (file.exists()) { - // 如果文件存在,创建文件系统资源对象 + // 创建文件系统资源对象,包装文件,http头不能使用file,所以使用FileSystemResource FileSystemResource resource = new FileSystemResource(file); // 设置HTTP头信息 HttpHeaders headers = new HttpHeaders(); diff --git a/ruoyi-ui/src/views/record/recordInspectionCabinet/index.vue b/ruoyi-ui/src/views/record/recordInspectionCabinet/index.vue index b8d8994..4a6d67b 100644 --- a/ruoyi-ui/src/views/record/recordInspectionCabinet/index.vue +++ b/ruoyi-ui/src/views/record/recordInspectionCabinet/index.vue @@ -42,8 +42,8 @@ @keyup.enter.native="handleQuery" /> --> - - + + 播放视频 - + @@ -240,7 +240,7 @@ - +