|
@@ -595,29 +595,38 @@ export default {
|
|
// 仅在线上使用活体检测
|
|
// 仅在线上使用活体检测
|
|
// if (process.env.NODE_ENV === "production" && faceVerifyMinute) {
|
|
// if (process.env.NODE_ENV === "production" && faceVerifyMinute) {
|
|
if (faceVerifyMinute) {
|
|
if (faceVerifyMinute) {
|
|
- const enoughTimeForFaceId = this.remainTime // 如果remainTime取到了的话
|
|
|
|
- ? this.remainTime / (60 * 1000) - 1 > faceVerifyMinute
|
|
|
|
- : true;
|
|
|
|
- if (!enoughTimeForFaceId) return;
|
|
|
|
-
|
|
|
|
- this.faceIdMsgTimeout = setTimeout(() => {
|
|
|
|
- // this.serverLog("debug/S-002001", "活体检测前抓拍");
|
|
|
|
- this.toggleSnapNow();
|
|
|
|
- this.$Message.info({
|
|
|
|
- content: "30秒后开始活体检测",
|
|
|
|
- duration: 15,
|
|
|
|
- closable: true,
|
|
|
|
- });
|
|
|
|
- }, faceVerifyMinute * 60 * 1000 - 30 * 1000); // 活体检测提醒
|
|
|
|
- this.faceIdDivTimeout = setTimeout(() => {
|
|
|
|
- // this.serverLog("debug/S-003001", "准备弹出活体检测框");
|
|
|
|
- if (identificationOfLivingBodyScheme === "S1") {
|
|
|
|
- this.showFaceId = true;
|
|
|
|
- } else if (identificationOfLivingBodyScheme === "S2") {
|
|
|
|
- this.showFaceMotion = true;
|
|
|
|
- }
|
|
|
|
- }, faceVerifyMinute * 60 * 1000); // 定时做活体检测
|
|
|
|
- // }, 1 * 1000); // 定时做活体检测
|
|
|
|
|
|
+ // 第二次开启活检时肯定有 this.remainTime 了。注意断点续考时没有这项检查
|
|
|
|
+ this.$nextTick(async () => {
|
|
|
|
+ await new Promise(r =>
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ r();
|
|
|
|
+ }, 10 * 1000)
|
|
|
|
+ );
|
|
|
|
+ console.log("活检定时");
|
|
|
|
+ const enoughTimeForFaceId = this.remainTime // 如果remainTime取到了的话
|
|
|
|
+ ? this.remainTime / (60 * 1000) - 1 > faceVerifyMinute
|
|
|
|
+ : true;
|
|
|
|
+ if (!enoughTimeForFaceId) return;
|
|
|
|
+
|
|
|
|
+ this.faceIdMsgTimeout = setTimeout(() => {
|
|
|
|
+ // this.serverLog("debug/S-002001", "活体检测前抓拍");
|
|
|
|
+ this.toggleSnapNow();
|
|
|
|
+ this.$Message.info({
|
|
|
|
+ content: "30秒后开始活体检测",
|
|
|
|
+ duration: 15,
|
|
|
|
+ closable: true,
|
|
|
|
+ });
|
|
|
|
+ }, faceVerifyMinute * 60 * 1000 - 30 * 1000); // 活体检测提醒
|
|
|
|
+ this.faceIdDivTimeout = setTimeout(() => {
|
|
|
|
+ // this.serverLog("debug/S-003001", "准备弹出活体检测框");
|
|
|
|
+ if (identificationOfLivingBodyScheme === "S1") {
|
|
|
|
+ this.showFaceId = true;
|
|
|
|
+ } else if (identificationOfLivingBodyScheme === "S2") {
|
|
|
|
+ this.showFaceMotion = true;
|
|
|
|
+ }
|
|
|
|
+ }, faceVerifyMinute * 60 * 1000); // 定时做活体检测
|
|
|
|
+ // }, 1 * 1000); // 定时做活体检测
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
// for test
|
|
// for test
|