|
@@ -159,7 +159,7 @@ public class CommonController {
|
|
|
String nickName = SecurityUtils.getLoginUser().getUser().getNickName();
|
|
|
// 下载源文件到本地临时目录
|
|
|
String tempSourceFile = System.getProperty("java.io.tmpdir") + File.separator + "source_" + FileUtils.getName(fileName);
|
|
|
- OssUtils.downloadFile(fileName, tempSourceFile);
|
|
|
+ OssUtils.downloadFile(fileName.replace("https://cysd.oss-cn-shanghai.aliyuncs.com/",""), tempSourceFile);
|
|
|
|
|
|
// 本地临时水印文件路径
|
|
|
String tempWatermarkFile = System.getProperty("java.io.tmpdir") + File.separator + "watermark_" + FileUtils.getName(fileName);
|
|
@@ -172,13 +172,14 @@ public class CommonController {
|
|
|
);
|
|
|
|
|
|
// 上传加水印的文件到OSS
|
|
|
- fileName = OssUtils.uploadFile(tempWatermarkFile);
|
|
|
+ fileNameResult = OssUtils.uploadFile(tempWatermarkFile);
|
|
|
|
|
|
// 删除临时文件
|
|
|
new File(tempSourceFile).delete();
|
|
|
new File(tempWatermarkFile).delete();
|
|
|
}
|
|
|
|
|
|
+ fileNameResult = fileNameResult.replace("https://cysd.oss-cn-shanghai.aliyuncs.com", fileUrl);
|
|
|
String url = fileNameResult;
|
|
|
AjaxResult ajax = AjaxResult.success();
|
|
|
ajax.put("url", url);
|