法大大验签

dev
IT-xiaoXiong 2021-11-18 10:59:40 +08:00
parent 1ef98ba1b4
commit 17c8cb4aad
3 changed files with 13 additions and 4 deletions

View File

@ -62,6 +62,10 @@ public class WritWatermark {
graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BILINEAR);
graphics.drawImage(image, 0, 0, width, height, null);
// 对字体进行限制
if(fontSize * pressText.length() >= width){
fontSize = (int) (width / (pressText.length() + 5));
}
Font font = new Font(fontName, fontStyle, fontSize);
graphics.setColor(color);
graphics.setFont(font);

View File

@ -10,6 +10,7 @@ import com.api.aiyh_pcn.fadada.dao.FaDDServiceMapping;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.apache.commons.codec.binary.Hex;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.h2.util.StringUtils;
import weaver.aiyh_pcn.fadada.entity.FileInfo;
import java.io.IOException;
@ -39,7 +40,11 @@ public class FaDDRequestUtils {
static {
header.put("appId", "100001");
header.put("signType", "SHA256");
header.put("apikey", "TulQxnZSRKeHoQfmeZzOUzGn6KpTDkDK");
String apiKey = TOOL_UTIL.getSystemParamValue("FDD_apiKey");
if(StringUtils.isNullOrEmpty(apiKey)){
apiKey = "TulQxnZSRKeHoQfmeZzOUzGn6KpTDkDK";
}
header.put("apikey", apiKey);
header.put("Content-Type", HttpArgsType.APPLICATION_JSON);
}
@ -158,12 +163,11 @@ public class FaDDRequestUtils {
"&bizContent=" + header.get("bizContent") +
"&signType=" + header.get("signType") +
"&timestamp=" + header.get("timestamp");
System.out.println(signStr);
// System.out.println(signStr);
String appKey = "L7P59oqA2An0XgJ1LeMN0fRu1";
String sha256 = string2SHA256(signStr) + appKey;
String sign = Base64.getEncoder().encodeToString(string2SHA256(sha256).getBytes(StandardCharsets.UTF_8));
// System.out.println(sign);
return sign;
return Base64.getEncoder().encodeToString(string2SHA256(sha256).getBytes(StandardCharsets.UTF_8));
}
public static String builderBizContent(Map<String, Object> data) {

View File

@ -502,6 +502,7 @@ public class NewTest extends BaseTest {
// Sheet sheet = sxssfWorkbook.createSheet("人员信息");
// Row desc = sheet.createRow(0);
// desc.createCell(1).setCellValue(null);
// System.out.println(i);
}
}