|
@@ -549,13 +549,14 @@ public class TaskExamPaperImportTemplete implements TaskImportTemplete {
|
|
if (("image".equals(type) || "audio".equals(type)) && StringUtils.isNotBlank(value) && !value.toLowerCase()
|
|
if (("image".equals(type) || "audio".equals(type)) && StringUtils.isNotBlank(value) && !value.toLowerCase()
|
|
.startsWith("https://") && !value.toLowerCase().startsWith("http://")) {
|
|
.startsWith("https://") && !value.toLowerCase().startsWith("http://")) {
|
|
if ("image".equals(type) && value.contains("data:image")) {
|
|
if ("image".equals(type) && value.contains("data:image")) {
|
|
- String suff = value.substring(11, value.indexOf(";"));
|
|
|
|
- byte[] bytes = Base64.decodeBase64(value.substring(value.indexOf(",") + 1));
|
|
|
|
- String filePath =
|
|
|
|
- "upload" + File.separator + DateUtil.format(new Date(), Constants.DATE_PATTERN) + File.separator + SystemConstant.getNanoId() + "." + suff;
|
|
|
|
- String md5 = BinaryUtil.toBase64String(BinaryUtil.calculateMd5(bytes));
|
|
|
|
- ossUtil.upload(true, filePath, new ByteArrayInputStream(bytes), md5);
|
|
|
|
- blockInfo.put("value", ossUtil.getAliYunOssPublicDomain().getPublicUrl() + "/" + filePath);
|
|
|
|
|
|
+// String suff = value.substring(11, value.indexOf(";"));
|
|
|
|
+// byte[] bytes = Base64.decodeBase64(value.substring(value.indexOf(",") + 1));
|
|
|
|
+// String filePath =
|
|
|
|
+// "upload" + File.separator + DateUtil.format(new Date(), Constants.DATE_PATTERN) + File.separator + SystemConstant.getNanoId() + "." + suff;
|
|
|
|
+// String md5 = BinaryUtil.toBase64String(BinaryUtil.calculateMd5(bytes));
|
|
|
|
+// ossUtil.upload(true, filePath, new ByteArrayInputStream(bytes), md5);
|
|
|
|
+// blockInfo.put("value", ossUtil.getAliYunOssPublicDomain().getPublicUrl() + "/" + filePath);
|
|
|
|
+ blockInfo.put("value", value);
|
|
} else {
|
|
} else {
|
|
String suff = value.substring(value.indexOf("."));
|
|
String suff = value.substring(value.indexOf("."));
|
|
String filePath =
|
|
String filePath =
|