react_hsbc_teller 2.0.16 → 2.0.17

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": "2.0.16",
3
+ "version": "2.0.17",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -57,6 +57,30 @@ class API extends Server{
57
57
  throw err;
58
58
  }
59
59
  }
60
+ /**
61
+ * 用途:获取录制状态
62
+ * @url https://api.cangdu.org/shopro/data/products
63
+ * 返回http_code为200表示成功
64
+ * @method post
65
+ * @return {promise}
66
+ */
67
+ async getRecordStatus(params = {}){
68
+ try{
69
+ let result = await this.axios('get', '/hsbc/record/status?roomId=' + params.roomId, params);
70
+ if(result && result.code === 200){
71
+ return result.data||[];
72
+ }else{
73
+ let err = {
74
+ tip: '录制状态获取失败',
75
+ response: result,
76
+ data: params,
77
+ }
78
+ throw err;
79
+ }
80
+ }catch(err){
81
+ throw err;
82
+ }
83
+ }
60
84
  /**
61
85
  * 用途:人脸检测
62
86
  * @url https://api.cangdu.org/shopro/data/products
@@ -53,7 +53,7 @@ import Step from '../components/step/step.jsx'
53
53
  import axios from 'axios';
54
54
  import CryptoJS from "crypto-js";
55
55
 
56
- const SDK_VERISON = '2.0.16'
56
+ const SDK_VERISON = '2.0.17'
57
57
  const IDtypeFront = '请客户在其设备后置摄像头下展示证件正面(如:身份证照片页面)'
58
58
  const IDtypeBack = '请在后置摄像头下展示证件反面(如:身份证国徽页)'
59
59
  const { Option } = Select;
@@ -1728,7 +1728,7 @@ class Video extends Component {
1728
1728
  }
1729
1729
  } else if (Mival.status == 2) {
1730
1730
  // 关闭了业务录制
1731
- console.log('业务录制关闭')
1731
+ console.log('业务录制关闭', this.state.businessRecordId)
1732
1732
  this.saveLog('Stop business recording')
1733
1733
  this.test_controller.StopRemoteRecord(this.state.businessRecordId)
1734
1734
  this.state.businessId = '';
@@ -3349,6 +3349,7 @@ class Video extends Component {
3349
3349
  type: '2'
3350
3350
  });
3351
3351
  console.log(result);
3352
+ this.queryRecordStatus()
3352
3353
  this.appGetUsername(document.getElementById('publish_video1').name)
3353
3354
  this.sendMessage({
3354
3355
  'typeId': 1014,
@@ -3718,6 +3719,31 @@ class Video extends Component {
3718
3719
  }
3719
3720
  }
3720
3721
  };
3722
+ queryRecordStatus = async()=>{
3723
+ try {
3724
+ let result = await API.getRecordStatus({
3725
+ roomId: this.state.channelId + ''
3726
+ });
3727
+ console.log('RecordStatus', result)
3728
+ if (result.fullRecordStatus == 1) { // 1开启 2未开启
3729
+ // 全局录制
3730
+ this.state.recordId = result.fullRecordId
3731
+ if (result.businessRecordStatus == 1){
3732
+ // 业务录制
3733
+ this.state.businessRecordId = result.businessRecordId;
3734
+ if (this.props.whetherDetectFace) this.startFaceDetection();
3735
+ if (this.props.whetherDetectLight) this.startImageDetection();
3736
+ }
3737
+ } else {
3738
+ this.state.recordId = ''
3739
+ }
3740
+ } catch (err) {
3741
+ console.error(err);
3742
+ if(err.status == 502 || err.status== 404) {
3743
+ this.roomCallBack(2, '连接服务器失败','SYS-02')
3744
+ }
3745
+ }
3746
+ }
3721
3747
  isFileSuccuse = () => {
3722
3748
  if (!this.state.sessionId || !this.state.sessionType || !this.state.imStatus) {
3723
3749
  this.messageClick('当前程序异常请先退出重开', 'error')
@@ -6073,7 +6099,11 @@ class Video extends Component {
6073
6099
  {!this.state.loading && this.state.sessionType && this.state.sessionId?
6074
6100
  <div className='QRCode'>
6075
6101
  <QRCode
6076
- value={this.state.sessionId} //value参数为生成二维码的链接
6102
+ value={JSON.stringify({
6103
+ sessionId:this.state.sessionId,
6104
+ staffId: this.props.tellerAccount,
6105
+ staffName: this.props.staffName
6106
+ })} //value参数为生成二维码的链接
6077
6107
  size={110} //二维码的宽高尺寸
6078
6108
  fgColor="#000000" //二维码的颜色
6079
6109
  />