|
@@ -12,6 +12,7 @@ import cn.com.qmth.examcloud.core.oe.student.dao.entity.ExamCaptureEntity;
|
|
import cn.com.qmth.examcloud.core.oe.student.service.ExamCaptureQueueService;
|
|
import cn.com.qmth.examcloud.core.oe.student.service.ExamCaptureQueueService;
|
|
import cn.com.qmth.examcloud.core.oe.student.service.ExamCaptureService;
|
|
import cn.com.qmth.examcloud.core.oe.student.service.ExamCaptureService;
|
|
import cn.com.qmth.examcloud.core.oe.student.service.ExamRecordDataService;
|
|
import cn.com.qmth.examcloud.core.oe.student.service.ExamRecordDataService;
|
|
|
|
+import cn.com.qmth.examcloud.starters.face.verify.common.CommonUtils;
|
|
import cn.com.qmth.examcloud.starters.face.verify.model.FaceResult;
|
|
import cn.com.qmth.examcloud.starters.face.verify.model.FaceResult;
|
|
import cn.com.qmth.examcloud.starters.face.verify.model.param.ImageBase64Parm;
|
|
import cn.com.qmth.examcloud.starters.face.verify.model.param.ImageBase64Parm;
|
|
import cn.com.qmth.examcloud.starters.face.verify.model.param.ImageParm;
|
|
import cn.com.qmth.examcloud.starters.face.verify.model.param.ImageParm;
|
|
@@ -201,9 +202,15 @@ public class ExamCaptureServiceImpl implements ExamCaptureService {
|
|
try {
|
|
try {
|
|
FaceResult faceResult;
|
|
FaceResult faceResult;
|
|
if (useBaiduApi) {
|
|
if (useBaiduApi) {
|
|
- String basePhotoUrl = ossClient.valueOfOssFilePath(student.getPhotoPath());
|
|
|
|
- byte[] basePhotoBytes = ossClient.download(basePhotoUrl);
|
|
|
|
- ImageParm basePhoto = new ImageBase64Parm(Base64.encodeBase64String(basePhotoBytes));
|
|
|
|
|
|
+ ImageParm basePhoto;
|
|
|
|
+ if (student.getPhotoPath().contains("upyun.qmth.com.cn")) {
|
|
|
|
+ // 兼容又拍云旧图片路径
|
|
|
|
+ basePhoto = new ImageBase64Parm(CommonUtils.toBase64(student.getPhotoPath()));
|
|
|
|
+ } else {
|
|
|
|
+ String basePhotoUrl = ossClient.valueOfOssFilePath(student.getPhotoPath());
|
|
|
|
+ byte[] basePhotoBytes = ossClient.download(basePhotoUrl);
|
|
|
|
+ basePhoto = new ImageBase64Parm(Base64.encodeBase64String(basePhotoBytes));
|
|
|
|
+ }
|
|
|
|
|
|
String capturePhotoUrl = ossClient.valueOfOssFilePath(FileStorageUtil.realPath(fileUrl));
|
|
String capturePhotoUrl = ossClient.valueOfOssFilePath(FileStorageUtil.realPath(fileUrl));
|
|
byte[] capturePhotoBytes = ossClient.download(capturePhotoUrl);
|
|
byte[] capturePhotoBytes = ossClient.download(capturePhotoUrl);
|