forked from dyf/fys-Multi-tenant
强制将HTTP替换为HTTPS
This commit is contained in:
@ -13,7 +13,7 @@ import java.net.URL;
|
||||
* 设备及完整类型信息导出DTO
|
||||
*
|
||||
* @author: 默苍璃
|
||||
* @date: 2025-11-0416:25
|
||||
* @date: 2025-11-04 16:25
|
||||
*/
|
||||
@Data
|
||||
@HeadRowHeight(20) // 表头行高
|
||||
|
||||
@ -286,6 +286,10 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
if (deviceForm.getFile() != null) {
|
||||
String fileHash = fileHashUtil.hash(deviceForm.getFile());
|
||||
SysOssVo upload = ossService.updateHash(deviceForm.getFile(), fileHash);
|
||||
// 强制将HTTP替换为HTTPS
|
||||
if (upload.getUrl() != null && upload.getUrl().startsWith("http://")) {
|
||||
upload.setUrl(upload.getUrl().replaceFirst("^http://", "https://"));
|
||||
}
|
||||
// 设置图片路径
|
||||
deviceForm.setDevicePic(upload.getUrl());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user