设置图片路径
This commit is contained in:
@ -267,9 +267,13 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
|
||||
// 处理上传的图片
|
||||
if (deviceForm.getFile() != null) {
|
||||
SysOssVo upload = ossService.upload(deviceForm.getFile());
|
||||
// 设置图片路径
|
||||
deviceForm.setDevicePic(upload.getUrl());
|
||||
SysOssVo oss = ossService.upload(deviceForm.getFile());
|
||||
// 强制将HTTP替换为HTTPS
|
||||
if (oss.getUrl() != null && oss.getUrl().startsWith("http://")) {
|
||||
oss.setUrl(oss.getUrl().replaceFirst("^http://", "https://"));
|
||||
}
|
||||
deviceForm.setDevicePic(oss.getUrl());
|
||||
}
|
||||
|
||||
// 更新字段
|
||||
|
||||
Reference in New Issue
Block a user