react_hsbc_teller 1.5.5 → 1.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/hsbc.js +1 -1
- package/package.json +1 -1
- package/packages/api/api.js +9 -9
- package/packages/pages/video/video.jsx +32 -38
package/package.json
CHANGED
package/packages/api/api.js
CHANGED
|
@@ -358,16 +358,16 @@ class API extends Server{
|
|
|
358
358
|
async contrastFaceVerify(params = {}){
|
|
359
359
|
try{
|
|
360
360
|
let result = await this.axios('post', '/hsbc/contrastFaceVerify', params);
|
|
361
|
-
if(result && result.code === 200){
|
|
361
|
+
// if(result && result.code === 200){
|
|
362
362
|
return result;
|
|
363
|
-
}else{
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
}
|
|
363
|
+
// }else{
|
|
364
|
+
// let err = {
|
|
365
|
+
// tip: '人脸识别失败',
|
|
366
|
+
// response: result,
|
|
367
|
+
// data: params,
|
|
368
|
+
// }
|
|
369
|
+
// throw err;
|
|
370
|
+
// }
|
|
371
371
|
}catch(err){
|
|
372
372
|
throw err;
|
|
373
373
|
}
|
|
@@ -562,13 +562,12 @@ class Video extends Component {
|
|
|
562
562
|
})
|
|
563
563
|
}
|
|
564
564
|
};
|
|
565
|
-
contrastFaceVerify = async
|
|
566
|
-
console.log(data);
|
|
565
|
+
contrastFaceVerify = async () => {
|
|
567
566
|
try {
|
|
568
567
|
let result = await API.contrastFaceVerify({
|
|
569
568
|
appAccount: this.state.faceCustomerUid,
|
|
570
569
|
sessionId: this.state.sessionId,
|
|
571
|
-
|
|
570
|
+
fileBase64: this.state.facialImg.replace(/^data:image\/\w+;base64,/,"")
|
|
572
571
|
});
|
|
573
572
|
console.log(result);
|
|
574
573
|
if (result.code == 200) {
|
|
@@ -2246,7 +2245,8 @@ class Video extends Component {
|
|
|
2246
2245
|
console.log(array, newArray, this.state.roomCustomerList);
|
|
2247
2246
|
this.state.roomCustomerList = newArray
|
|
2248
2247
|
let config_param
|
|
2249
|
-
if (itemOne.tag
|
|
2248
|
+
if (rateList.indexOf(itemOne.tag) > -1) {
|
|
2249
|
+
// itemOne.tag == 'VIDEO_SOURCE_SCREEN'
|
|
2250
2250
|
config_param = {
|
|
2251
2251
|
subscribe_video_id: 'video21',
|
|
2252
2252
|
subscribe_audio_id: 'audio21',
|
|
@@ -3179,32 +3179,6 @@ class Video extends Component {
|
|
|
3179
3179
|
}
|
|
3180
3180
|
}
|
|
3181
3181
|
}
|
|
3182
|
-
contrastFaceVerify = async data => {
|
|
3183
|
-
console.log(data);
|
|
3184
|
-
try {
|
|
3185
|
-
let result = await API.contrastFaceVerify({
|
|
3186
|
-
appAccount: this.state.faceCustomerUid,
|
|
3187
|
-
sessionId: this.state.sessionId,
|
|
3188
|
-
imagePath: data
|
|
3189
|
-
});
|
|
3190
|
-
console.log(result);
|
|
3191
|
-
if (result.code == 200) {
|
|
3192
|
-
this.messageClick('人脸识别成功','success')
|
|
3193
|
-
this.setState({
|
|
3194
|
-
isModalVisibleFacial: false
|
|
3195
|
-
})
|
|
3196
|
-
} else {
|
|
3197
|
-
this.messageClick('人脸识别失败','error')
|
|
3198
|
-
}
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
} catch (err) {
|
|
3202
|
-
console.error(err);
|
|
3203
|
-
if(err.status == 502 || err.status== 404) {
|
|
3204
|
-
this.roomCallBack(2, '连接服务器失败','SYS-02')
|
|
3205
|
-
}
|
|
3206
|
-
}
|
|
3207
|
-
};
|
|
3208
3182
|
componentWillUnmount() {
|
|
3209
3183
|
|
|
3210
3184
|
if (this.state.roomCustomerList.length == 0 && this.state.sessionType) {
|
|
@@ -3538,6 +3512,7 @@ class Video extends Component {
|
|
|
3538
3512
|
// publish_config.video_profile_diy={width:1280, height:720, frameRate:8, bitrate:1500}
|
|
3539
3513
|
publish_config.enableDesktopAudio=true
|
|
3540
3514
|
publish_config.degradationType=2
|
|
3515
|
+
publish_config.desktopStreamToCanvas=true
|
|
3541
3516
|
publish_config.sid = document.getElementById('video20').name
|
|
3542
3517
|
this.test_controller.ChangeMediaStream(publish_config)
|
|
3543
3518
|
this.state.isScreenSwitching = true
|
|
@@ -3549,6 +3524,7 @@ class Video extends Component {
|
|
|
3549
3524
|
// publish_config.video_profile_type=100
|
|
3550
3525
|
// publish_config.video_profile_diy={width:1280, height:720, frameRate:8, bitrate:1500}
|
|
3551
3526
|
publish_config.enableDesktopAudio=true
|
|
3527
|
+
publish_config.desktopStreamToCanvas=true
|
|
3552
3528
|
publish_config.degradationType=2
|
|
3553
3529
|
publish_config.sid = document.getElementById('video20').name;
|
|
3554
3530
|
this.test_controller.ChangeMediaStream(publish_config);
|
|
@@ -3557,6 +3533,7 @@ class Video extends Component {
|
|
|
3557
3533
|
publish_config.publish_device = 2
|
|
3558
3534
|
publish_config.need_volume_analyser = true
|
|
3559
3535
|
publish_config.video_profile_type = 1
|
|
3536
|
+
publish_config.desktopStreamToCanvas=true
|
|
3560
3537
|
// publish_config.video_profile_type=100
|
|
3561
3538
|
// publish_config.video_profile_diy={width:1280, height:720, frameRate:8, bitrate:1500}
|
|
3562
3539
|
publish_config.enableDesktopAudio=true
|
|
@@ -3726,11 +3703,12 @@ class Video extends Component {
|
|
|
3726
3703
|
this.ocrCallback()
|
|
3727
3704
|
|
|
3728
3705
|
} else {
|
|
3729
|
-
|
|
3730
|
-
const
|
|
3731
|
-
formData
|
|
3732
|
-
formData.append('
|
|
3733
|
-
this.
|
|
3706
|
+
this.contrastFaceVerify()
|
|
3707
|
+
// const frontIdcard = new File([this.dataURLtoFile(this.state.facialImg, 'image/jpeg')], new Date() + '.png'); // 重命名了
|
|
3708
|
+
// const formData = new FormData();
|
|
3709
|
+
// formData.append('file', frontIdcard);
|
|
3710
|
+
// formData.append('sessionId', this.state.sessionId);
|
|
3711
|
+
// this.uploadImg(formData)
|
|
3734
3712
|
}
|
|
3735
3713
|
|
|
3736
3714
|
};
|
|
@@ -4109,6 +4087,14 @@ class Video extends Component {
|
|
|
4109
4087
|
height = ((bottom - top)* window.screen.width / document.body.clientWidth) - 30
|
|
4110
4088
|
x = (left * window.screen.width / document.body.clientWidth)
|
|
4111
4089
|
y = (top* window.screen.width / document.body.clientWidth) + 8
|
|
4090
|
+
// width = ((right - left)* 1280 / document.body.clientWidth) - 5
|
|
4091
|
+
// height = ((bottom - top)* 1280 / document.body.clientWidth) - 30
|
|
4092
|
+
// x = (left* 1280 / document.body.clientWidth)
|
|
4093
|
+
// y = (top* 1280 / document.body.clientWidth) + 8
|
|
4094
|
+
// width = ((right - left)) - 5
|
|
4095
|
+
// height = ((bottom - top)) - 30
|
|
4096
|
+
// x = (left)
|
|
4097
|
+
// y = (top) + 8
|
|
4112
4098
|
canvas.width = 960;
|
|
4113
4099
|
canvas.height = 540;
|
|
4114
4100
|
|
|
@@ -4120,13 +4106,14 @@ class Video extends Component {
|
|
|
4120
4106
|
function loop() {
|
|
4121
4107
|
if (!$this.paused && !$this.ended) {
|
|
4122
4108
|
// if(!that.state.tabTitles.find(el=>el.value == 'customerScreen')) {
|
|
4109
|
+
console.log('addEventListener',x, y, width, height)
|
|
4123
4110
|
cobj.drawImage(videoMedia, x, y, width, height, 0, 0,960, 540);
|
|
4124
4111
|
// } else {
|
|
4125
4112
|
// cobj.fillStyle = 'rgb(0 0 0)'
|
|
4126
4113
|
// cobj.fillRect(0,0,960,540)
|
|
4127
4114
|
// }
|
|
4128
4115
|
|
|
4129
|
-
setTimeout(loop, 1000 /
|
|
4116
|
+
setTimeout(loop, 1000 / 20); // drawing at 30fps
|
|
4130
4117
|
}
|
|
4131
4118
|
}
|
|
4132
4119
|
|
|
@@ -4156,6 +4143,10 @@ class Video extends Component {
|
|
|
4156
4143
|
navigator.mediaDevices.getDisplayMedia({
|
|
4157
4144
|
video: true,
|
|
4158
4145
|
preferCurrentTab:true,
|
|
4146
|
+
// video: {
|
|
4147
|
+
// width: document.body.clientWidth,
|
|
4148
|
+
// height: document.body.clientHeight
|
|
4149
|
+
// }
|
|
4159
4150
|
})
|
|
4160
4151
|
.then((stream) => {
|
|
4161
4152
|
if(streamShare) {
|
|
@@ -4164,6 +4155,8 @@ class Video extends Component {
|
|
|
4164
4155
|
}
|
|
4165
4156
|
videoMedia.srcObject = stream;
|
|
4166
4157
|
stream.getVideoTracks()[0].applyConstraints({
|
|
4158
|
+
// width: 1280,
|
|
4159
|
+
// height: 720
|
|
4167
4160
|
width: window.screen.width,
|
|
4168
4161
|
height: window.screen.height
|
|
4169
4162
|
})
|
|
@@ -4391,7 +4384,8 @@ class Video extends Component {
|
|
|
4391
4384
|
sendNotification = () =>{
|
|
4392
4385
|
console.log(this.props.shareMask,this.state.shareMaskState)
|
|
4393
4386
|
this.state.shareMaskState = this.props.shareMask
|
|
4394
|
-
//
|
|
4387
|
+
// 加延迟是因为在关闭的时候可以看到部分rm的操作
|
|
4388
|
+
setTimeout(() => {
|
|
4395
4389
|
callNimIM('sendCustomCmdMsg', {
|
|
4396
4390
|
customId: this.state.imRoomId,
|
|
4397
4391
|
content: JSON.stringify({
|
|
@@ -4400,7 +4394,7 @@ class Video extends Component {
|
|
|
4400
4394
|
'type': this.state.shareMaskState ? 1 : 2
|
|
4401
4395
|
})
|
|
4402
4396
|
});
|
|
4403
|
-
|
|
4397
|
+
},100)
|
|
4404
4398
|
|
|
4405
4399
|
}
|
|
4406
4400
|
componentDidUpdate(prevProps){
|