react_hsbc_teller 1.5.5 → 1.5.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react_hsbc_teller",
3
- "version": "1.5.5",
3
+ "version": "1.5.6",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -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
- let err = {
365
- tip: '上传图片失败',
366
- response: result,
367
- data: params,
368
- }
369
- throw err;
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 data => {
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
- imagePath: data
570
+ fileBase64: this.state.facialImg.replace(/^data:image\/\w+;base64,/,"")
572
571
  });
573
572
  console.log(result);
574
573
  if (result.code == 200) {
@@ -3179,32 +3178,6 @@ class Video extends Component {
3179
3178
  }
3180
3179
  }
3181
3180
  }
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
3181
  componentWillUnmount() {
3209
3182
 
3210
3183
  if (this.state.roomCustomerList.length == 0 && this.state.sessionType) {
@@ -3726,11 +3699,12 @@ class Video extends Component {
3726
3699
  this.ocrCallback()
3727
3700
 
3728
3701
  } else {
3729
- const frontIdcard = new File([this.dataURLtoFile(this.state.facialImg, 'image/jpeg')], new Date() + '.png'); // 重命名了
3730
- const formData = new FormData();
3731
- formData.append('file', frontIdcard);
3732
- formData.append('sessionId', this.state.sessionId);
3733
- this.uploadImg(formData)
3702
+ this.contrastFaceVerify()
3703
+ // const frontIdcard = new File([this.dataURLtoFile(this.state.facialImg, 'image/jpeg')], new Date() + '.png'); // 重命名了
3704
+ // const formData = new FormData();
3705
+ // formData.append('file', frontIdcard);
3706
+ // formData.append('sessionId', this.state.sessionId);
3707
+ // this.uploadImg(formData)
3734
3708
  }
3735
3709
 
3736
3710
  };
@@ -4105,10 +4079,14 @@ class Video extends Component {
4105
4079
  let height = 0
4106
4080
  let x = 0
4107
4081
  let y = 0
4108
- width = ((right - left)* window.screen.width / document.body.clientWidth) - 5
4109
- height = ((bottom - top)* window.screen.width / document.body.clientWidth) - 30
4110
- x = (left * window.screen.width / document.body.clientWidth)
4111
- y = (top* window.screen.width / document.body.clientWidth) + 8
4082
+ // width = ((right - left)* window.screen.width / document.body.clientWidth) - 5
4083
+ // height = ((bottom - top)* window.screen.width / document.body.clientWidth) - 30
4084
+ // x = (left * window.screen.width / document.body.clientWidth)
4085
+ // y = (top* window.screen.width / document.body.clientWidth) + 8
4086
+ width = ((right - left)* 1280 / document.body.clientWidth) - 5
4087
+ height = ((bottom - top)* 1280 / document.body.clientWidth) - 30
4088
+ x = (left* 1280 / document.body.clientWidth)
4089
+ y = (top* 1280 / document.body.clientWidth) + 8
4112
4090
  canvas.width = 960;
4113
4091
  canvas.height = 540;
4114
4092
 
@@ -4126,7 +4104,7 @@ class Video extends Component {
4126
4104
  // cobj.fillRect(0,0,960,540)
4127
4105
  // }
4128
4106
 
4129
- setTimeout(loop, 1000 / 10); // drawing at 30fps
4107
+ setTimeout(loop, 1000 / 20); // drawing at 30fps
4130
4108
  }
4131
4109
  }
4132
4110
 
@@ -4156,6 +4134,10 @@ class Video extends Component {
4156
4134
  navigator.mediaDevices.getDisplayMedia({
4157
4135
  video: true,
4158
4136
  preferCurrentTab:true,
4137
+ video: {
4138
+ width: 1280,
4139
+ height: 720
4140
+ }
4159
4141
  })
4160
4142
  .then((stream) => {
4161
4143
  if(streamShare) {
@@ -4163,10 +4145,12 @@ class Video extends Component {
4163
4145
  streamShare = ''
4164
4146
  }
4165
4147
  videoMedia.srcObject = stream;
4166
- stream.getVideoTracks()[0].applyConstraints({
4167
- width: window.screen.width,
4168
- height: window.screen.height
4169
- })
4148
+ // stream.getVideoTracks()[0].applyConstraints({
4149
+ // width: 1280,
4150
+ // height: 720
4151
+ // // width: window.screen.width,
4152
+ // // height: window.screen.height
4153
+ // })
4170
4154
 
4171
4155
  streamShare = stream
4172
4156
  stream.getVideoTracks()[0].onended = async ()=>{