react_hsbc_teller 1.8.1 → 1.8.4

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.1",
3
+ "version": "1.8.4",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -1,7 +1,62 @@
1
1
  import Server from './server';
2
2
 
3
3
  class API extends Server{
4
-
4
+ // /hsbc/getAuthorizeResult/{activityId}/{appAccount}
5
+ async getAuthorizeResult(params = {}){
6
+ try{
7
+ let result = await this.axios('get', '/hsbc/getAuthorizeResult/'+params.activityId + '/' + params.appAccount, params);
8
+ if(result && result.code === 200){
9
+ return result||'';
10
+ }else{
11
+ let err = {
12
+ tip: '服务异常',
13
+ response: result,
14
+ data: params,
15
+ // url: 'https://api.cangdu.org/shopro/data/products',
16
+ }
17
+ throw err;
18
+ }
19
+ }catch(err){
20
+ throw err;
21
+ }
22
+ }
23
+ async saveAuthorize(params = {}){
24
+ try{
25
+ let result = await this.axios('post', '/hsbc/saveAuthorize', params);
26
+ if(result && result.code === 200){
27
+ return result||'';
28
+ }else{
29
+ let err = {
30
+ tip: '服务异常',
31
+ response: result,
32
+ data: params,
33
+ // url: 'https://api.cangdu.org/shopro/data/products',
34
+ }
35
+ throw err;
36
+ }
37
+ }catch(err){
38
+ throw err;
39
+ }
40
+ }
41
+ // /hsbc/getToken
42
+ async getToken(params = {}){
43
+ try{
44
+ let result = await this.axios('post', '/hsbc/getToken', params);
45
+ if(result && result.code === 200){
46
+ return result.data||'';
47
+ }else{
48
+ let err = {
49
+ tip: '服务异常',
50
+ response: result,
51
+ data: params,
52
+ // url: 'https://api.cangdu.org/shopro/data/products',
53
+ }
54
+ throw err;
55
+ }
56
+ }catch(err){
57
+ throw err;
58
+ }
59
+ }
5
60
  async confirmCallback(params = {}){
6
61
  // return this.axios('get', '/lang/select/2', params);
7
62
  try{
@@ -28,7 +28,9 @@ export default class Server {
28
28
  timeout: 30000,
29
29
  params: null,
30
30
  data: params,
31
- headers: null,
31
+ // headers: {
32
+ // Authorization: window.sessionStorage.getItem('authTokenHSBC') ? window.sessionStorage.getItem('authTokenHSBC') : '',
33
+ // },
32
34
  withCredentials: true, //是否携带cookies发起请求
33
35
  validateStatus:(status)=>{
34
36
  return status >= 200 && status < 300;
@@ -137,14 +137,15 @@ export default class foot extends Component {
137
137
  </Popover>
138
138
  }
139
139
  {
140
- item == 'OCR' && <Popover content={content} trigger="click" visible={clickedOcr} onVisibleChange={this.ocrHandleVisibleChange}>
140
+ item == 'OCR' &&
141
+ // <Popover content={content} trigger="click" visible={clickedOcr} onVisibleChange={this.ocrHandleVisibleChange}>
141
142
  <div className="one" onClick={this.ocrClick.bind(this)}>
142
143
  <img className="imgClass" src={require("../../assets/img/icon_ocr.png").default} alt="" />
143
144
  <div className="text">
144
145
  OCR识别
145
146
  </div>
146
147
  </div>
147
- </Popover>
148
+ // </Popover>
148
149
  }
149
150
  {
150
151
  item == 'INVITE' && <div className="one" onClick={this.invitationClick.bind(this)}>
@@ -164,14 +165,14 @@ export default class foot extends Component {
164
165
  </div>
165
166
  </div>
166
167
  }
167
- {/* {
168
+ {
168
169
  item == 'BEAUTY' && <div className="one" onClick={this.beautyClick.bind(this)}>
169
170
  <img className="imgClass" src={require("../../assets/img/meiyan.png").default} alt="" />
170
171
  <div className="text">
171
172
  {beautyName}
172
173
  </div>
173
174
  </div>
174
- } */}
175
+ }
175
176
  </div>
176
177
 
177
178
  })