跳转OSS云存储的压缩规则

This commit is contained in:
gxwebsoft
2024-03-29 15:31:54 +08:00
parent e1d8d66905
commit 4174b9c58c

View File

@@ -261,11 +261,10 @@ public class FileController extends BaseController {
String requestURL = config.getFileServer();
for (FileRecord record : result.getList()) {
if (StrUtil.isNotBlank(record.getPath())) {
record.setUrl(record.getPath());
if (FileServerUtil.isImage(record.getContentType())) {
record.setThumbnail(record.getPath() + "?x-oss-process=image/resize,m_fixed,w_100,h_100/quality,Q_90");
record.setPath(record.getPath() + "?x-oss-process=image/resize,m_fixed,w_100,w_750/quality,Q_90");
record.setUrl(record.getPath() + "?x-oss-process=image/resize,m_fixed,w_100,w_1680/quality,Q_90");
record.setPath(record.getPath() + "?x-oss-process=image/resize,m_fixed,w_750/quality,Q_90");
record.setUrl(record.getPath() + "?x-oss-process=image/resize,m_fixed,w_1680/quality,Q_90");
}
record.setDownloadUrl(record.getPath());
}
@@ -281,11 +280,10 @@ public class FileController extends BaseController {
String requestURL = config.getFileServer();
for (FileRecord record : records) {
if (StrUtil.isNotBlank(record.getPath())) {
record.setUrl(requestURL + record.getPath());
if (FileServerUtil.isImage(record.getContentType())) {
record.setThumbnail(record.getPath() + "?x-oss-process=image/resize,m_fixed,w_100,h_100/quality,Q_90");
record.setPath(record.getPath() + "?x-oss-process=image/resize,m_fixed,w_100,w_750/quality,Q_90");
record.setUrl(record.getPath() + "?x-oss-process=image/resize,m_fixed,w_100,w_1680/quality,Q_90");
record.setPath(record.getPath() + "?x-oss-process=image/resize,m_fixed,w_750/quality,Q_90");
record.setUrl(record.getPath() + "?x-oss-process=image/resize,m_fixed,w_1680/quality,Q_90");
}
record.setDownloadUrl(record.getPath());
}