提交 27371157 编写于 作者: O o2sword

修复云文件缩略图接口图片类型判断缺少的问题

上级 c1a8a1a0
......@@ -8,6 +8,7 @@ import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WrapString;
import com.x.file.assemble.control.ThisApplication;
import com.x.file.core.entity.open.FileType;
import com.x.file.core.entity.open.OriginFile;
import com.x.file.core.entity.personal.Attachment2;
import org.apache.commons.codec.binary.Base64;
......@@ -30,7 +31,7 @@ class ActionGetImageScaleBase64 extends BaseAction {
throw new Exception("person{name:" + effectivePerson.getDistinguishedName() + "} access attachment{id:"
+ id + "} denied.");
}
if (!ArrayUtils.contains(IMAGE_EXTENSIONS, attachment.getExtension())) {
if (!FileType.getExtType(attachment.getExtension()).equals(FileType.image.name())) {
throw new Exception("attachment not image file.");
}
if (scale < 0 || scale > 100) {
......@@ -64,4 +65,4 @@ class ActionGetImageScaleBase64 extends BaseAction {
public static class Wo extends WrapString {
}
}
\ No newline at end of file
}
......@@ -11,6 +11,7 @@ import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WrapString;
import com.x.file.assemble.control.ThisApplication;
import com.x.file.core.entity.open.FileType;
import com.x.file.core.entity.open.OriginFile;
import com.x.file.core.entity.personal.Attachment2;
import org.apache.commons.codec.binary.Base64;
......@@ -36,7 +37,7 @@ class ActionGetImageWidthHeightBase64 extends BaseAction {
throw new Exception("person{name:" + effectivePerson.getDistinguishedName() + "} access attachment{id:"
+ id + "} denied.");
}
if (!ArrayUtils.contains(IMAGE_EXTENSIONS, attachment.getExtension())) {
if (!FileType.getExtType(attachment.getExtension()).equals(FileType.image.name())) {
throw new Exception("attachment not image file.");
}
if (width < 0 || width > 5000) {
......@@ -89,4 +90,4 @@ class ActionGetImageWidthHeightBase64 extends BaseAction {
public static class Wo extends WrapString {
}
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册