tsurumure пре 3 месеци
родитељ
комит
5b17270ed1

+ 3 - 0
src/main/java/com/backendsys/modules/upload/controller/SysFileMultipartController.java

@@ -35,6 +35,9 @@ public class SysFileMultipartController {
     @PreAuthorize("@sr.hasPermission(1.1)")
     @PostMapping("/api/upload/multipartUploadInit")
     public Result multipartUploadInit(@RequestParam("file") MultipartFile multipartFile, Long category_id, Integer upload_chunk_count, String md5) {
+
+        System.out.println("初始化分块上传(调试)");
+
         return Result.success().put("data", sysFileMultipartService.multipartUploadInit(multipartFile, category_id, upload_chunk_count, md5));
     }
 

+ 5 - 5
src/main/java/com/backendsys/modules/upload/service/impl/SysFileMultipartServiceImpl.java

@@ -151,11 +151,11 @@ public class SysFileMultipartServiceImpl implements SysFileMultipartService {
     public Map<String, Object> multipartUploadInit(MultipartFile multipartFile, Long category_id, Integer upload_chunk_count, String md5) {
 
         if (multipartFile.isEmpty()) throw new CustException("file 上传文件不能为空");
-        if (upload_chunk_count == null) throw new CustException("upload_chunk_count 分块数量不能为空");
-        if (md5.isEmpty()) throw new CustException("md5 不能为空");
-
-        String filename = multipartFile.getOriginalFilename();
-        if (filename.length() > 50) throw new CustException("文件名长度不能超过 50 字符");
+//        if (upload_chunk_count == null) throw new CustException("upload_chunk_count 分块数量不能为空");
+//        if (md5.isEmpty()) throw new CustException("md5 不能为空");
+//
+//        String filename = multipartFile.getOriginalFilename();
+//        if (filename.length() > 50) throw new CustException("文件名长度不能超过 50 字符");
 
 //        // 按用户加锁
 //        RLock lock = redissonClient.getLock("lock::multipart-upload::user-id::" + SecurityUtil.getUserId());