react_hsbc_teller 0.6.9 → 0.7.0

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": "0.6.9",
3
+ "version": "0.7.0",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -3,6 +3,7 @@ import JKL from './JKL';
3
3
 
4
4
  let websock;
5
5
  let id;
6
+ let fromHostName;
6
7
  const xmlLang = 'zh';
7
8
  const version = '1.0';
8
9
  let islogin = false;
@@ -36,6 +37,9 @@ function websocketonopen() { // 连接建立之后执行send方法发送数据
36
37
  // 发送建立流请求
37
38
  const steam = {
38
39
  open: {
40
+ // '-to': 'im.uat.dsp.hsbcfts.com.cn',
41
+ // '-from': `${'web'}@${'im.uat.dsp.hsbcfts.com.cn'}`,
42
+
39
43
  '-to': JSON.parse(window.sessionStorage.getItem('sigData')).hostname,
40
44
  '-from': `${JSON.parse(window.sessionStorage.getItem('sigData')).account}@${JSON.parse(window.sessionStorage.getItem('sigData')).hostname}`,
41
45
  '-xmlns': 'urn:ietf:params:xml:ns:xmpp-framing',
@@ -84,7 +88,8 @@ function websocketonmessage(e) {
84
88
  } else if (undefined != jsondata.open) {
85
89
  // 记录id
86
90
  id = jsondata.open['-id'];
87
- console.log(id);
91
+ fromHostName = jsondata.open["-from"];
92
+ console.log('记录id',id,fromHostName);
88
93
  } else if (undefined != jsondata['stream:features']) {
89
94
  if (undefined != jsondata['stream:features'].mechanisms) {
90
95
  // 获取登录验证方式
@@ -159,7 +164,7 @@ function newopen() {
159
164
  '-xmlns': 'jabber:client',
160
165
  '-to': JSON.parse(window.sessionStorage.getItem('sigData')).hostname,
161
166
  '-version': version,
162
- '-from': `${JSON.parse(window.sessionStorage.getItem('sigData')).account}@${JSON.parse(window.sessionStorage.getItem('sigData')).hostname}`,
167
+ '-from': JSON.parse(window.sessionStorage.getItem('sigData')).account + '@' + fromHostName,
163
168
  '-id': id,
164
169
  '-xml:lang': xmlLang,
165
170
  },
@@ -184,7 +189,9 @@ function bind() {
184
189
  function auth(val) {
185
190
  // Base64编码
186
191
  console.log('www');
187
- const token = window.btoa(`${JSON.parse(window.sessionStorage.getItem('sigData')).account}@${JSON.parse(window.sessionStorage.getItem('sigData')).hostname}\0` + `${JSON.parse(window.sessionStorage.getItem('sigData')).openfireToken}`);
192
+ // const token = window.btoa('web'+'@'+ fromHostName+ '\0' + '123');
193
+
194
+ const token = window.btoa(JSON.parse(window.sessionStorage.getItem('sigData')).account + '@' + fromHostName + '\0' + JSON.parse(window.sessionStorage.getItem('sigData')).openfireToken);
188
195
  const message = {
189
196
  auth: {
190
197
  '-xmlns': 'urn:ietf:params:xml:ns:xmpp-sasl',
@@ -46,8 +46,8 @@ class Main extends Component {
46
46
  }
47
47
  Main.defaultProps = {
48
48
  lang: 'zh',
49
- baseURL: 'https://zuul.uat.dsp.hsbcfts.com.cn/wealth/zuul/api/leimon-counter-api',
50
- // baseURL:'https://counter-web.leimondata.cn:18082/api/leimon-counter-api',
49
+ // baseURL: 'https://zuul.uat.dsp.hsbcfts.com.cn/wealth/zuul/api/leimon-counter-api',
50
+ baseURL:'https://counter-web.leimondata.cn:18082/api/leimon-counter-api',
51
51
 
52
52
  }
53
53
  export default Main
@@ -179,6 +179,12 @@ class Video extends Component {
179
179
  appId: result.appId,
180
180
  bizName: result.bizName
181
181
  });
182
+ // const data1={
183
+ // hostname: 'im.uat.dsp.hsbcfts.com.cn',
184
+ // webPort: '443',
185
+ // account: 'web',
186
+ // openfireToken: '123'
187
+ // }
182
188
  window.sessionStorage.setItem('sigData', JSON.stringify(result));
183
189
  if (data.sigType == 1) {
184
190
  this.handleEdit()
@@ -191,6 +197,9 @@ class Video extends Component {
191
197
  handleEdit = () => {
192
198
  console.log(JSON.parse(window.sessionStorage.getItem('sigData')));
193
199
  // eslint-disable-next-line no-undef
200
+ // initWebSocket('wss://im.uat.dsp.hsbcfts.com.cn:443/wealth/im/ws/')
201
+ // initWebSocket('wss://' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname + ':' + '15603' + '/ws/');
202
+
194
203
  initWebSocket('wss://' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname + ':' + JSON.parse(window.sessionStorage.getItem('sigData')).webPort + '/ws/');
195
204
  const config_param = {};
196
205
  config_param.workspaceId = this.state.workSpaceId;
@@ -3477,11 +3486,11 @@ Video.defaultProps = {
3477
3486
  tellerAccount: 't001',
3478
3487
  businessNumber: '123',
3479
3488
  callbackUrl: 'http://47.102.126.132:8720/hsbc/callback',
3480
- roomServerUrl: 'wss://app.uat.dsp.hsbcfts.com.cn/mpaas/mrtc/ws',
3481
- // roomServerUrl: 'wss://mrtc.mpaas.cn-hangzhou.aliyuncs.com/ws',
3489
+ // roomServerUrl: 'wss://app.uat.dsp.hsbcfts.com.cn/mpaas/mrtc/ws',
3490
+ roomServerUrl: 'wss://mrtc.mpaas.cn-hangzhou.aliyuncs.com/ws',
3482
3491
 
3483
- // resourcePath: 'https://counter-web.leimondata.cn:7199',
3484
- resourcePath: 'https://zuul.uat.dsp.hsbcfts.com.cn/wealth/js/',
3492
+ resourcePath: 'https://counter-web.leimondata.cn:7199',
3493
+ // resourcePath: 'https://zuul.uat.dsp.hsbcfts.com.cn/wealth/js/',
3485
3494
  prohbiitPrompt: '当前无客户',
3486
3495
  voiceColor: '#0AE544',
3487
3496
  titleBackground: 'rgba(0,0,0,0.65)',
package/src/index.js CHANGED
@@ -2,8 +2,8 @@ import React from "react";
2
2
  import ReactDOM from "react-dom";
3
3
  import "./index.less";
4
4
  import '@babel/polyfill';
5
- import { HSBC } from "../lib/hsbc";
6
- // import {HSBC} from "../packages";
5
+ // import { HSBC } from "../lib/hsbc";
6
+ import {HSBC} from "../packages";
7
7
 
8
8
  ReactDOM.render(
9
9
  <div className="hsbc"><HSBC></HSBC></div>,