跳转OSS云存储的压缩规则
This commit is contained in:
@@ -261,12 +261,13 @@ public class FileController extends BaseController {
|
||||
String requestURL = config.getFileServer();
|
||||
for (FileRecord record : result.getList()) {
|
||||
if (StrUtil.isNotBlank(record.getPath())) {
|
||||
record.setDownloadUrl(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_750/quality,Q_90");
|
||||
record.setUrl(record.getPath() + "?x-oss-process=image/resize,m_fixed,w_1680/quality,Q_90");
|
||||
record.setUrl(record.getDownloadUrl() + "?x-oss-process=image/resize,m_fixed,w_1680/quality,Q_90");
|
||||
}
|
||||
record.setDownloadUrl(record.getPath());
|
||||
|
||||
}
|
||||
}
|
||||
return success(result);
|
||||
@@ -280,12 +281,12 @@ public class FileController extends BaseController {
|
||||
String requestURL = config.getFileServer();
|
||||
for (FileRecord record : records) {
|
||||
if (StrUtil.isNotBlank(record.getPath())) {
|
||||
record.setDownloadUrl(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_750/quality,Q_90");
|
||||
record.setUrl(record.getPath() + "?x-oss-process=image/resize,m_fixed,w_1680/quality,Q_90");
|
||||
record.setUrl(record.getDownloadUrl() + "?x-oss-process=image/resize,m_fixed,w_1680/quality,Q_90");
|
||||
}
|
||||
record.setDownloadUrl(record.getPath());
|
||||
}
|
||||
}
|
||||
return success(records);
|
||||
|
||||
Reference in New Issue
Block a user