Parcourir la source

feat:开启图片查重

shc il y a 2 ans
Parent
commit
84e4c1f286

+ 12 - 12
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/ApiController.java

@@ -1018,18 +1018,18 @@ public class ApiController {
 
 		}
 
-		// if (CollUtil.isNotEmpty(ducImgUrl)) {
-		// 	// 保存图片
-		// 	log.info("all size:{}", all.size());
-		// 	if (CollUtil.isNotEmpty(all)) {
-		// 		all.forEach(hash -> {
-		// 			String key = String.format("%s:%s", id, hash);
-		// 			log.info("key: {}", key);
-		// 			redisTemplate.delete(key);
-		// 		});
-		// 	}
-		// 	return R.failed(ducImgUrl, "提交重复的图片");
-		// }
+		if (CollUtil.isNotEmpty(ducImgUrl)) {
+			// 保存图片
+			log.info("all size:{}", all.size());
+			if (CollUtil.isNotEmpty(all)) {
+				all.forEach(hash -> {
+					String key = String.format("%s:%s", id, hash);
+					log.info("key: {}", key);
+					redisTemplate.delete(key);
+				});
+			}
+			return R.failed(ducImgUrl, "提交重复的图片");
+		}
 
 		if (org.apache.commons.lang.StringUtils.isEmpty(wmTaskContent.getTemp30())) {
 			return R.failed("任务类型不能为空");