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) {