1. 中铝e办组织机构人员同步联调接口
2. 设置默认文件预览水印为人员加日期
This commit is contained in:
@@ -165,4 +165,15 @@ public class FileController {
|
||||
return CommonResult.customize(fileRespVO, HttpStatus.OK.value(), e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/verify-code")
|
||||
@Operation(summary = "校验验证码")
|
||||
public CommonResult<String> verifyCode(@Valid @RequestParam Long fileId, @RequestParam String code) throws Exception {
|
||||
Long userId = getLoginUserId();
|
||||
byte[] content = fileService.verifyCodeAndGetFile(fileId, userId, code);
|
||||
if(content == null || content.length == 0){
|
||||
return CommonResult.customize(null, HttpStatus.INTERNAL_SERVER_ERROR.value(), "验证码校验失败");
|
||||
}
|
||||
return CommonResult.customize(null, HttpStatus.OK.value(), "验证码校验通过");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package cn.iocoder.yudao.module.infra.controller.admin.file.vo.file;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.spring.SpringUtils;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient;
|
||||
import cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClient;
|
||||
import cn.iocoder.yudao.module.infra.service.file.FileConfigService;
|
||||
@@ -11,6 +13,7 @@ import lombok.experimental.Accessors;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Base64;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author chenbowen
|
||||
@@ -78,7 +81,9 @@ public class FileRespVO {
|
||||
}
|
||||
String base64PresignedUrl = Base64.getEncoder().encodeToString(presignedUrl.getBytes(StandardCharsets.UTF_8));
|
||||
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||
String watermark = SpringUtils.getProperty("aj.captcha.water-mark", "中国铜业");
|
||||
String loginUserNickname = SecurityFrameworkUtils.getLoginUserNickname();
|
||||
String format = DateUtil.format(new Date(), "yyyy-MM-dd");
|
||||
String watermark = SpringUtils.getProperty("aj.captcha.water-mark", loginUserNickname+" "+ format);
|
||||
return onlinePreview + base64PresignedUrl + "&t=" + timestamp + "&watermarkTxt=" + watermark;
|
||||
}
|
||||
@Schema(description = "是否加密", example = "false")
|
||||
|
||||
Reference in New Issue
Block a user