|
@@ -76,8 +76,14 @@ public class FaceVerifyServiceImpl implements FaceVerifyService {
|
|
|
// image_type: URL、BASE64、FACE_TOKEN,其中“本地化部署API”不支持 URL 方式
|
|
|
Map<String, String> imageData = new HashMap<>();
|
|
|
if (ImageParmType.FILE_URL == image.type()) {
|
|
|
- imageData.put("image_type", "URL");
|
|
|
- imageData.put("image", image.value());
|
|
|
+ if (properties.getBaiduLocalEnabled()) {
|
|
|
+ String imageBase64 = CommonUtils.toBase64(image.value());
|
|
|
+ imageData.put("image", imageBase64);
|
|
|
+ imageData.put("image_type", "BASE64");
|
|
|
+ } else {
|
|
|
+ imageData.put("image_type", "URL");
|
|
|
+ imageData.put("image", image.value());
|
|
|
+ }
|
|
|
} else if (ImageParmType.FACE_TOKEN == image.type()) {
|
|
|
imageData.put("image_type", "FACE_TOKEN");
|
|
|
imageData.put("image", image.value());
|