From 4d2dcfce2f1b0ae59a50e9ade003f90f747fc93c Mon Sep 17 00:00:00 2001 From: duan Date: Thu, 1 Sep 2022 13:19:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(src/views/user):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/user/index.vue | 54 ++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/views/user/index.vue b/src/views/user/index.vue index c5efe28..d92d308 100644 --- a/src/views/user/index.vue +++ b/src/views/user/index.vue @@ -91,8 +91,8 @@ > @@ -251,7 +251,7 @@ >
- +
程小红
工号:779
@@ -437,31 +437,31 @@ export default { faceStart().then(res => { setTimeout(() => { this.play = process.env.VUE_APP_FACE_API + '/face/play/' - }, 200) - }) - this.rflag = true - this.dialogFaceVisible = true - this.web_stream = webStream.get(process.env.VUE_APP_FACE_API + '/face/play/', (data) => { - if (data.length > 41) { - const buffer = Buffer.allocUnsafe(data.byteLength - 41) - data.copy(buffer, 0, 37) - this.img_src = buffer.toString('base64') - const count = Math.floor(Math.random() * 10 + 1) - // 随机抽样 - if (count < 3) { - this.img_list.push('data:image/png;base64,' + this.img_src) - } - if (this.img_list.length > 10 && this.rflag) { - const data = { - 'images': this.img_list, - 'user_id': row.user_id + this.web_stream = webStream.get(process.env.VUE_APP_FACE_API + '/face/play/', (data) => { + if (data.length > 41) { + const buffer = Buffer.allocUnsafe(data.byteLength - 41) + data.copy(buffer, 0, 37) + this.img_src = buffer.toString('base64') + const count = Math.floor(Math.random() * 10 + 1) + // 随机抽样 + if (count < 2) { + this.img_list.push('data:image/png;base64,' + this.img_src) + } + if (this.img_list.length > 10 && this.rflag) { + const data = { + 'images': this.img_list, + 'user_id': row.user_id + } + faceAdd(data).then((res) => { + this.rflag = false + }) + this.img_list = [] + } } - faceAdd(data).then((res) => { - this.rflag = false - }) - this.img_list = [] - } - } + }) + this.rflag = true + this.dialogFaceVisible = true + }, 200) }) }, handleRole(index, row) {