react_hsbc_teller 1.8.2 → 1.8.3

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.8.2",
3
+ "version": "1.8.3",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -1,7 +1,26 @@
1
1
  import Server from './server';
2
2
 
3
3
  class API extends Server{
4
-
4
+ // /hsbc/getToken
5
+ async getToken(params = {}){
6
+ // return this.axios('get', '/lang/select/2', params);
7
+ try{
8
+ let result = await this.axios('post', '/hsbc/getToken', params);
9
+ if(result && result.code === 200){
10
+ return result.data||'';
11
+ }else{
12
+ let err = {
13
+ tip: '服务异常',
14
+ response: result,
15
+ data: params,
16
+ // url: 'https://api.cangdu.org/shopro/data/products',
17
+ }
18
+ throw err;
19
+ }
20
+ }catch(err){
21
+ throw err;
22
+ }
23
+ }
5
24
  async confirmCallback(params = {}){
6
25
  // return this.axios('get', '/lang/select/2', params);
7
26
  try{
@@ -28,7 +28,6 @@ export default class Server {
28
28
  timeout: 30000,
29
29
  params: null,
30
30
  data: params,
31
- headers: null,
32
31
  withCredentials: true, //是否携带cookies发起请求
33
32
  validateStatus:(status)=>{
34
33
  return status >= 200 && status < 300;
@@ -164,14 +164,14 @@ export default class foot extends Component {
164
164
  </div>
165
165
  </div>
166
166
  }
167
- {/* {
167
+ {
168
168
  item == 'BEAUTY' && <div className="one" onClick={this.beautyClick.bind(this)}>
169
169
  <img className="imgClass" src={require("../../assets/img/meiyan.png").default} alt="" />
170
170
  <div className="text">
171
171
  {beautyName}
172
172
  </div>
173
173
  </div>
174
- } */}
174
+ }
175
175
  </div>
176
176
 
177
177
  })
@@ -12,6 +12,7 @@ import voiceImgOpen from '../../assets/img/icon_Mute.png'
12
12
  import voiceImgCloe from '../../assets/img/icon_MuteOne.png'
13
13
  import cameraImgOpen from '../../assets/img/icon_camera.png'
14
14
  import cameraImgCloe from '../../assets/img/icon_cameraOne.png'
15
+ import beautyImg from '../../assets/img/whiteningLut.jpg'
15
16
  import ocrImage from '../../assets/img/jietu.png'
16
17
  import autod from '../../assets/mp3/joinmeeting.mp3'
17
18
  import leftMetting from '../../assets/mp3/leftmeeting.mp3'
@@ -42,7 +43,8 @@ let streamShare
42
43
  let muteJson = new Map()
43
44
  let dateTime = 0
44
45
  let messageValue = ''
45
- let beautyNum = 0 // 0-关闭 1--弱 2--中 5---高
46
+ let beautyType = false
47
+ // let beautyNum = 0 // 0-关闭 1--弱 2--中 5---高
46
48
  let rateList = []
47
49
  let beautyDiv = {};
48
50
  let isBackgroundBlur = true
@@ -91,12 +93,10 @@ const OpreateDiv = styled.div`
91
93
  }
92
94
  beautyDiv = {};
93
95
  };
94
- function startBeauty(stream) {
95
- let newStream = stream;
96
- beautyDiv = meetingBeautifyStream(newStream, beautyNum);
97
- newStream = beautyDiv.stream;
98
- return newStream
99
- }
96
+ async function startBeauty(stream) {
97
+ await beautyInit();
98
+ beautyStart(stream,"none");
99
+ }
100
100
  async function startMix(stream,onState) {
101
101
  var drawCanvas = document.getElementById('canvas');
102
102
  await mixInit(drawCanvas);
@@ -307,7 +307,32 @@ class Video extends Component {
307
307
  // eslint-disable-next-line no-undef
308
308
  test_controller = '';
309
309
 
310
-
310
+ saveLog=(val)=>{
311
+ axios({
312
+ method: 'post',
313
+ baseURL: `http://${this.props.project}.${this.props.endpoint}/logstores/${this.props.logstore}/track`,
314
+ headers: {
315
+ 'x-log-apiversion': '0.6.0',
316
+ 'x-log-bodyrawsize': '1234',
317
+ },
318
+ data: {
319
+ "__logs__": [
320
+ {
321
+ "key": val + this.state.channelId
322
+ }
323
+ ]
324
+ },
325
+
326
+ }).then(res => {
327
+
328
+ },error => {
329
+ if(error.response){
330
+
331
+ }else{
332
+
333
+ }
334
+ })
335
+ }
311
336
  /**
312
337
  * 创建房间成功后回调后台
313
338
  * @param {JSON} data 数据类型
@@ -319,7 +344,8 @@ class Video extends Component {
319
344
  activityId: this.props.businessNumber,
320
345
  callbackUrl: this.props.callbackUrl,
321
346
  roomId: this.state.channelId,
322
- mtoken: this.state.rtoken
347
+ mtoken: this.state.rtoken,
348
+ type: 2
323
349
  });
324
350
  console.log(result);
325
351
  this.state.imRoomId = result.imRoomId,
@@ -342,6 +368,7 @@ class Video extends Component {
342
368
  if(this.state.imStatus && !this.state.imJoinRoom) {
343
369
  joinRoom((this.props.tellerAccount + '@' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname), this.state.imRoomId)
344
370
  this.state.imJoinRoom =true
371
+ this.saveLog('加入IM房间')
345
372
  console.log('加入IM房间')
346
373
  }
347
374
  })
@@ -356,10 +383,12 @@ class Video extends Component {
356
383
  roomId: this.state.channelId
357
384
  }
358
385
  })
386
+ // this.saveLog()
359
387
  } catch (err) {
360
388
  console.error(err);
361
389
 
362
390
  this.state.sessionType = false
391
+ this.saveLog('创建房间---保存信息失败')
363
392
  if(err.status == 502 || err.status== 404) {
364
393
  this.roomCallBack(2, '连接服务器失败','SYS-02')
365
394
  } else {
@@ -436,6 +465,7 @@ class Video extends Component {
436
465
  this.handleEdit()
437
466
  }
438
467
  } catch (err) {
468
+ this.saveLog('签名失败')
439
469
  console.error(err);
440
470
  if(err.status == 502 || err.status== 404) {
441
471
  this.roomCallBack(2, '连接服务器失败','SYS-02')
@@ -453,7 +483,6 @@ class Video extends Component {
453
483
  if(!this.state.imStatus){
454
484
  this.state.manualClose = false
455
485
  initWebSocket('wss://' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname + ':' + JSON.parse(window.sessionStorage.getItem('sigData')).webPort + '/ws/');
456
-
457
486
  }
458
487
  const config_param = {};
459
488
  config_param.workspaceId = this.state.workSpaceId;
@@ -1080,6 +1109,7 @@ class Video extends Component {
1080
1109
  }
1081
1110
  };
1082
1111
  endSessionValue = () => {
1112
+ this.saveLog('主动退出会议')
1083
1113
  if(streamShare) {
1084
1114
  streamShare.getTracks().forEach(track => track.stop());
1085
1115
  streamShare=''
@@ -1412,6 +1442,7 @@ class Video extends Component {
1412
1442
  this.setState({
1413
1443
  loading: false,
1414
1444
  })
1445
+ this.saveLog('失败的code:' + code)
1415
1446
  if (this.state.sessionId) {
1416
1447
  if(code == 'SYS-01' || code == 'SYS-02') {
1417
1448
  this.props.joinRoomCallback({
@@ -1948,6 +1979,7 @@ class Video extends Component {
1948
1979
  console.log('im登录', msg)
1949
1980
  if(msg.status == 'error') {
1950
1981
  this.state.imStatus = false
1982
+ this.saveLog('im建立连接失败')
1951
1983
  this.roomCallBack(2, 'im建立连接失败',5)
1952
1984
  } else if (msg.status == 'success') {
1953
1985
  this.state.imStatus = true
@@ -1963,6 +1995,7 @@ class Video extends Component {
1963
1995
  this.timer && clearInterval(this.timer);
1964
1996
  this.state.imStatus = false
1965
1997
  console.log('IMOpenfireclose')
1998
+ this.saveLog('账号重复登录')
1966
1999
  this.roomCallBack(2, '账号重复登录',9)
1967
2000
 
1968
2001
  }
@@ -2098,6 +2131,7 @@ class Video extends Component {
2098
2131
  // 获取设备失败
2099
2132
  this.test_controller.OnGetDevicesFailed = (code, msg) => {
2100
2133
  console.log('获取设备失败', code, msg)
2134
+ this.saveLog('获取设备失败')
2101
2135
  this.state.sessionType = false
2102
2136
  this.messageClick('获取设备失败,请检查摄像头设备是否可用或是否禁用摄像头','error')
2103
2137
  this.roomCallBack(2, '获取设备失败',1)
@@ -2109,6 +2143,7 @@ class Video extends Component {
2109
2143
  };
2110
2144
  this.test_controller.OnConnectFailed = (code, msg) => {
2111
2145
  console.log('建立连接失败', code, msg)
2146
+ this.saveLog('建立连接失败,'+ code)
2112
2147
  this.state.sessionType = false
2113
2148
  this.roomCallBack(2, '连接失败',2)
2114
2149
  };
@@ -2124,6 +2159,7 @@ class Video extends Component {
2124
2159
  // 初始化房间失败
2125
2160
  this.test_controller.OnInitRoomConfigFail = (err_code, err_msg) => {
2126
2161
  console.log('初始化房间失败', err_code, err_msg)
2162
+ this.saveLog('初始化房间失败,' + err_code)
2127
2163
  this.state.sessionType = false
2128
2164
  this.roomCallBack(2, '初始化失败',3)
2129
2165
  };
@@ -2149,6 +2185,7 @@ class Video extends Component {
2149
2185
  // 创建房间失败
2150
2186
  this.test_controller.OnCreateRoomFailed = (err_code, err_msg) => {
2151
2187
  console.log('创建房间失败', err_code, err_msg)
2188
+ this.saveLog('创建房间失败,' + err_code)
2152
2189
  this.state.sessionType = false
2153
2190
  this.roomCallBack(2, '创建房间失败',7)
2154
2191
  };
@@ -2165,6 +2202,7 @@ class Video extends Component {
2165
2202
  console.log(code, sid)
2166
2203
  if(code == 5003 || code == 5004 || code == 5005|| code == 5007|| code == 5009|| code == 5010 || code == 5011|| code == 5012) {
2167
2204
  if(sid == document.getElementById('publish_video1').name) {
2205
+ this.saveLog('音视频关闭通知' + code)
2168
2206
  this.roomCallBack(2, '音视频异常关闭',8)
2169
2207
  } else {
2170
2208
  this.state.isScreenSwitching = false
@@ -2191,6 +2229,7 @@ class Video extends Component {
2191
2229
  };
2192
2230
  // 加入房间失败
2193
2231
  this.test_controller.OnJoinRoomFailed = (err_code, err_msg) => {
2232
+ this.saveLog('加入房间失败' + err_code)
2194
2233
  console.log('加入房间失败', err_code, err_msg)
2195
2234
  // this.setState({
2196
2235
  // sessionType: false,
@@ -2236,24 +2275,26 @@ class Video extends Component {
2236
2275
  if(publish_tag == 'tag1') {
2237
2276
  console.log('tag1',stream)
2238
2277
  let newStream = stream;
2239
- let beauty_strength = beautyNum;
2240
- if (beauty_strength != 0 && stream.getVideoTracks()[0]) {
2241
- newStream = new MediaStream([startBeauty(stream).getVideoTracks()[0]]);
2242
- // 清理原始流
2243
- newStream.oninactive = function () {
2244
- clearOriginStream(stream);
2245
- };
2246
- newStream.getVideoTracks()[0].onended = function () {
2247
- clearOriginStream(stream);
2248
- };
2249
- function clearOriginStream(stream) {
2250
- stream.getTracks().forEach((track) => {
2251
- track.stop();
2252
- });
2253
- stream = null;
2254
- }
2255
- };
2278
+ // if (stream.getVideoTracks()[0]) {
2279
+ // await startBeauty(newStream);
2280
+ // newStream = beautyCaptureStream();
2281
+ // // 清理原始流
2282
+ // newStream.oninactive = function () {
2283
+ // clearOriginStream(stream);
2284
+ // };
2285
+ // newStream.getVideoTracks()[0].onended = function () {
2286
+ // clearOriginStream(stream);
2287
+ // };
2288
+ // function clearOriginStream(stream) {
2289
+ // stream.getTracks().forEach((track) => {
2290
+ // track.stop();
2291
+ // });
2292
+ // stream = null;
2293
+ // }
2294
+ // };
2256
2295
  if (stream.getVideoTracks()[0]) {
2296
+ await startBeauty(newStream);
2297
+ newStream = beautyCaptureStream();
2257
2298
  await startHs(newStream);
2258
2299
  newStream = hsCaptureStream();
2259
2300
  // 清理原始流
@@ -2393,6 +2434,7 @@ class Video extends Component {
2393
2434
  };
2394
2435
  // 发布媒体流失败
2395
2436
  this.test_controller.OnPublishFailed = (sid, err_code, err_msg) => {
2437
+ this.saveLog('发布失败' + err_code)
2396
2438
  console.log('发布媒体流失败', sid, err_code, err_msg)
2397
2439
  if(sid == document.getElementById('publish_video1').name) {
2398
2440
  this.state.sessionType = false
@@ -2579,6 +2621,7 @@ class Video extends Component {
2579
2621
  err_msg
2580
2622
  ) => {
2581
2623
  console.log('订阅媒体流失败', sid, err_code, err_msg)
2624
+ this.saveLog('订阅媒体流失败' + err_code)
2582
2625
  };
2583
2626
  // 推送“房间与会者列表”给新加⼊者
2584
2627
  this.test_controller.OnRoomAttendanceList = (participants) => {
@@ -3599,9 +3642,9 @@ userType:'1'
3599
3642
  }
3600
3643
  }
3601
3644
  componentWillUnmount() {
3645
+ this.saveLog('退出会议')
3602
3646
  if (this.test_controller&&this.state.sessionType) {
3603
3647
  clearStreamRemain()
3604
- beautyNum = 0
3605
3648
  this.test_controller.LeaveRoom()
3606
3649
  this.test_controller.Disconnect()
3607
3650
  }
@@ -3656,7 +3699,9 @@ userType:'1'
3656
3699
  });
3657
3700
  if (result.code == 200 && result.data.roomStatus == 1) {
3658
3701
  this.addToScript()
3702
+
3659
3703
  } else {
3704
+ console.log('123')
3660
3705
  this.state.channelId = '',
3661
3706
  this.state.rtoken = '',
3662
3707
  this.state.sessionId = '',
@@ -3672,6 +3717,7 @@ userType:'1'
3672
3717
  // })
3673
3718
  }
3674
3719
  } catch (err) {
3720
+ console.log('456')
3675
3721
  this.state.channelId = '',
3676
3722
  this.state.rtoken = '',
3677
3723
  this.state.sessionId = '',
@@ -3692,7 +3738,7 @@ userType:'1'
3692
3738
  loading: true,
3693
3739
  })
3694
3740
  const that = this
3695
- axios.get(this.props.resourcePath + "/beauty/beauty.js")
3741
+ axios.get(this.props.resourcePath + "/mcu.js")
3696
3742
  .then(response => this.addToScriptClick()).catch(function (error) {
3697
3743
  console.log(error);
3698
3744
  that.state.sessionType = false
@@ -3707,14 +3753,9 @@ userType:'1'
3707
3753
  }
3708
3754
  addToScriptClick=()=>{
3709
3755
  const _dependScripts = [
3710
- // https://counter-web.leimondata.cn:7199
3711
- this.props.resourcePath + "/beauty/beauty.js",
3712
- this.props.resourcePath + "/beauty/meeting_beautify_stream.js",
3713
- this.props.resourcePath + "/beauty/backgroundBlur.js",
3714
-
3756
+ this.props.resourcePath + "/beauty/beauty_frame_pkg.js",
3715
3757
  this.props.resourcePath + "/adapter.js",
3716
3758
  this.props.resourcePath + "/getMediaInfo.js",
3717
- // this.props.resourcePath + "/pdf.js",
3718
3759
  this.props.resourcePath + "/EBML.js",
3719
3760
  this.props.resourcePath + "/mcu.js",
3720
3761
  this.props.resourcePath + "/meeting_desk_stream.js",
@@ -3748,7 +3789,7 @@ userType:'1'
3748
3789
  if (i < _dependScripts.length) {
3749
3790
  const script = document.createElement("script");
3750
3791
  script.src = _dependScripts[i];
3751
- script.type = 'text/javascript'
3792
+ // script.type = 'text/javascript'
3752
3793
  script.async = true;
3753
3794
  document.head.appendChild(script);
3754
3795
  if (i == _dependScripts.length - 1) {
@@ -4898,19 +4939,30 @@ userType:'1'
4898
4939
  })
4899
4940
  }
4900
4941
  beautyClick = () =>{
4901
- const publish_config = {}
4902
- publish_config.sid = document.getElementById('publish_video1').name
4903
- publish_config.media_type = 1
4904
- publish_config.publish_device = 1
4905
- publish_config.videoSource = this.state.cameraValue
4906
- publish_config.audioSource = this.state.microphoneValue
4907
- publish_config.video_profile_type=100
4908
- publish_config.video_profile_diy={width:640, height:360, frameRate:15, bitrate:400}
4909
- this.test_controller.ChangeMediaStream(publish_config)
4910
- beautyNum = beautyNum == 0 ? 1 : 0
4911
- this.setState({
4912
- beautyName: beautyNum == 0 ? '开启美颜' : '关闭美颜'
4913
- })
4942
+ // const publish_config = {}
4943
+ // publish_config.sid = document.getElementById('publish_video1').name
4944
+ // publish_config.media_type = 1
4945
+ // publish_config.publish_device = 1
4946
+ // publish_config.videoSource = this.state.cameraValue
4947
+ // publish_config.audioSource = this.state.microphoneValue
4948
+ // publish_config.video_profile_type=100
4949
+ // publish_config.video_profile_diy={width:640, height:360, frameRate:15, bitrate:400}
4950
+ // this.test_controller.ChangeMediaStream(publish_config)
4951
+ // beautyNum = beautyNum == 0 ? 1 : 0
4952
+ if(beautyType) {
4953
+ beautyType = false
4954
+ this.setState({
4955
+ beautyName: '开启美颜'
4956
+ })
4957
+ beautySetMode('none')
4958
+ } else {
4959
+ beautyType = true
4960
+ beautySetMode('beauty')
4961
+ this.setState({
4962
+ beautyName: '关闭美颜'
4963
+ })
4964
+ }
4965
+
4914
4966
  }
4915
4967
  componentDidMount() {
4916
4968
  var box=document.getElementById("whiteboardDIV");
@@ -5917,6 +5969,9 @@ sessionId: "",
5917
5969
  isTranscribing: false,
5918
5970
  shareMask: false,
5919
5971
  isOpenSound: false, // true开启进出音效 false不开启
5972
+ endpoint: 'cn-shanghai.log.aliyuncs.com',
5973
+ project: 'hsbc',
5974
+ logstore: 'hsbc',
5920
5975
  internalUrl: 'https://wp-staff-gateway.wealth-platform.uat.ali.cloud.cn.hsbc/meeting-ui/OHB/CN/HSBC?chnlID=OHB&locale=zh_CN&chnlCC=CN&chnlGMC=HSBC&targetFunc=supervisorMeeting&sourceFunc=rmMeeting'
5921
5976
  }
5922
5977
  export default Video