强制将HTTP替换为HTTPS

This commit is contained in:
2025-11-25 14:51:10 +08:00
parent 1e9e815314
commit bf182ebc89
4 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,5 @@
package com.fuyuanshen.app.controller; package com.fuyuanshen.app.controller;
import cn.dev33.satoken.annotation.SaIgnore;
import com.fuyuanshen.app.service.AudioProcessService; import com.fuyuanshen.app.service.AudioProcessService;
import com.fuyuanshen.app.service.VideoProcessService; import com.fuyuanshen.app.service.VideoProcessService;
import com.fuyuanshen.common.core.domain.R; import com.fuyuanshen.common.core.domain.R;
@ -14,7 +13,6 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.IOException; import java.io.IOException;
import java.util.Base64;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -74,4 +72,5 @@ public class AppVideoController extends BaseController {
public R<String> extract(@RequestParam("file") MultipartFile file) throws Exception { public R<String> extract(@RequestParam("file") MultipartFile file) throws Exception {
return R.ok("Success", audioProcessService.extract(file)); return R.ok("Success", audioProcessService.extract(file));
} }
} }

View File

@ -13,7 +13,7 @@ import java.net.URL;
* 设备及完整类型信息导出DTO * 设备及完整类型信息导出DTO
* *
* @author: 默苍璃 * @author: 默苍璃
* @date: 2025-11-0416:25 * @date: 2025-11-04 16:25
*/ */
@Data @Data
@HeadRowHeight(20) // 表头行高 @HeadRowHeight(20) // 表头行高

View File

@ -286,6 +286,10 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
if (deviceForm.getFile() != null) { if (deviceForm.getFile() != null) {
String fileHash = fileHashUtil.hash(deviceForm.getFile()); String fileHash = fileHashUtil.hash(deviceForm.getFile());
SysOssVo upload = ossService.updateHash(deviceForm.getFile(), fileHash); 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()); deviceForm.setDevicePic(upload.getUrl());
} }

View File

@ -51,6 +51,7 @@ public class SysOss extends TenantEntity {
* 服务商 * 服务商
*/ */
private String service; private String service;
/** /**
* 内容哈希 * 内容哈希
*/ */