增加forest

master
冯凯 2023-10-28 20:48:28 +08:00
parent 2b6324c874
commit c2ff23d1fc
1 changed files with 4 additions and 0 deletions

View File

@ -42,12 +42,15 @@ public class SysIdCardController {
@PostMapping("/bindIdCard")
public Result bindIdCard(@RequestParam("faceImage")MultipartFile faceImage,@RequestParam("backImage") MultipartFile backImage) throws IOException {
//获取正面头像照片的字节流
System.out.println(SecurityUtils.getLoginUser());
String username = SecurityUtils.getUsername();
System.out.println("当前登录人是"+username);
byte[] faceImageBytes = faceImage.getBytes();
//获取反面国徽面的字节流
byte[] backImageBytes = backImage.getBytes();
String face = Base64.getEncoder().encodeToString(faceImageBytes);
Map faceMap = forestClientInterface.helloForestFace(face);
System.out.println(faceMap);
String address = (String) faceMap.get("address");
String birthday = (String) faceMap.get("birth");
String name = (String) faceMap.get("name");
@ -61,6 +64,7 @@ public class SysIdCardController {
Configure configure = new Configure();
configure.setSide(IdCardConfigureType.Back.getType());
Map backMap = forestClientInterface.helloForestBack(back, configure);
System.out.println(backMap);
String issueOffice = (String) backMap.get("issue");
IdCard idCard = new IdCard();
idCard.setName(name);