|
@@ -27,6 +27,7 @@ import cn.com.qmth.examcloud.support.examing.ExamRecordData;
|
|
|
import cn.com.qmth.examcloud.support.filestorage.FileStorageUtil;
|
|
|
import cn.com.qmth.examcloud.support.helper.ExamCacheTransferHelper;
|
|
|
import cn.com.qmth.examcloud.support.helper.FaceBiopsyHelper;
|
|
|
+import cn.com.qmth.examcloud.web.config.SystemProperties;
|
|
|
import cn.com.qmth.examcloud.web.facepp.FaceppClient;
|
|
|
import cn.com.qmth.examcloud.web.redis.RedisClient;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
@@ -55,6 +56,8 @@ public class ExamCaptureServiceImpl implements ExamCaptureService {
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(ExamCaptureServiceImpl.class);
|
|
|
|
|
|
+ public static final String TEMP_FILE_EXP = "face_compare/";
|
|
|
+
|
|
|
@Autowired
|
|
|
private ExamCaptureRepo examCaptureRepo;
|
|
|
|
|
@@ -70,7 +73,8 @@ public class ExamCaptureServiceImpl implements ExamCaptureService {
|
|
|
@Autowired
|
|
|
private FaceVerifyService faceVerifyService;
|
|
|
|
|
|
- public static final String TEMP_FILE_EXP = "face_compare/";
|
|
|
+ @Autowired
|
|
|
+ private SystemProperties systemProperties;
|
|
|
|
|
|
@Autowired
|
|
|
private RedisClient redisClient;
|
|
@@ -194,9 +198,11 @@ public class ExamCaptureServiceImpl implements ExamCaptureService {
|
|
|
|
|
|
try {
|
|
|
FaceResult faceResult;
|
|
|
- ImageParm imageParm = new ImageUrlParm(FileStorageUtil.realPath(fileUrl));
|
|
|
+ String capturePhotoUrl = systemProperties.replaceFileUrlInternalDomain(FileStorageUtil.realPath(fileUrl));
|
|
|
+ ImageParm imageParm = new ImageUrlParm(capturePhotoUrl);
|
|
|
if (useBaiduApi) {
|
|
|
- faceResult = faceVerifyService.faceCompareByBaidu(new ImageUrlParm(student.getPhotoPath()), imageParm, baiduExpectFaceCompareScore);
|
|
|
+ String basePhotoUrl = systemProperties.replaceFileUrlInternalDomain(student.getPhotoPath());
|
|
|
+ faceResult = faceVerifyService.faceCompareByBaidu(new ImageUrlParm(basePhotoUrl), imageParm, baiduExpectFaceCompareScore);
|
|
|
} else {
|
|
|
faceResult = faceVerifyService.faceCompareByFacePlus(new ImageTokenParm(student.getFaceToken()), imageParm);
|
|
|
}
|