@gjzq/sdk 1.6.0-beta.3 → 1.6.0-beta.5

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.
@@ -5338,6 +5338,27 @@ http.interceptors.request.use(function (config) {
5338
5338
  http.interceptors.response.use(authMiddleware);
5339
5339
  http.interceptors.response.use(parseResponseMiddleware);
5340
5340
 
5341
+ // 封装支持跨域cookie共享的http函数
5342
+ var httpWithCred = {
5343
+ get: function get(url, params) {
5344
+ return params && Object.keys(params).length > 0 ? http.get(url, _assign(_assign({}, params), {
5345
+ withCredentials: true
5346
+ })) : http.get(url, {
5347
+ withCredentials: true
5348
+ });
5349
+ },
5350
+ post: function post(url, data) {
5351
+ return http.post(url, data, {
5352
+ withCredentials: true
5353
+ });
5354
+ },
5355
+ patch: function patch(url, data) {
5356
+ return http.patch(url, data, {
5357
+ withCredentials: true
5358
+ });
5359
+ }
5360
+ };
5361
+
5341
5362
  /**
5342
5363
  * yjb3.0-user登录-phpsession状态同步
5343
5364
  * @function userLogin
@@ -5345,7 +5366,7 @@ http.interceptors.response.use(parseResponseMiddleware);
5345
5366
  * @returns {Promise<HttpResponse>}
5346
5367
  */
5347
5368
  function userLoginForWeb(param) {
5348
- return http.post("".concat(API_URL, "/login/user"), param);
5369
+ return httpWithCred.post("".concat(API_URL, "/login/user"), param);
5349
5370
  }
5350
5371
 
5351
5372
  /**
@@ -5355,7 +5376,7 @@ function userLoginForWeb(param) {
5355
5376
  * @returns {Promise<HttpResponse>}
5356
5377
  */
5357
5378
  function pidLogin(param) {
5358
- return http.post("".concat(API_URL, "/login/passport"), param);
5379
+ return httpWithCred.post("".concat(API_URL, "/login/passport"), param);
5359
5380
  }
5360
5381
 
5361
5382
  function readHybridNoSystemParam$1() {
@@ -5371,7 +5392,7 @@ function readHybridNoSystemParam$1() {
5371
5392
  });
5372
5393
  }
5373
5394
  function checkFundAccountLoginFromServer() {
5374
- return http.get(API_URL + '/login/fundAccount');
5395
+ return httpWithCred.get(API_URL + '/login/fundAccount');
5375
5396
  }
5376
5397
  //委托客户端请求yjbapi
5377
5398
  function fetchYJBAPI(param_1) {
@@ -5584,7 +5605,7 @@ function getUserTokenForHybrid() {
5584
5605
  * multiLogin 功能组件
5585
5606
  */
5586
5607
  function multiLogin(param) {
5587
- return http.post("".concat(API_URL, "/login/multi"), param);
5608
+ return httpWithCred.post("".concat(API_URL, "/login/multi"), param);
5588
5609
  }
5589
5610
 
5590
5611
  /* eslint-disable @typescript-eslint/no-unused-vars */
@@ -5709,9 +5730,9 @@ function readHybridSystemParamIgnoreError(keys) {
5709
5730
  */
5710
5731
  function logoutForWeb(loginType) {
5711
5732
  if (loginType) {
5712
- return http.post("".concat(API_URL, "/logout/").concat(loginType));
5733
+ return httpWithCred.post("".concat(API_URL, "/logout/").concat(loginType));
5713
5734
  }
5714
- return http.post("".concat(API_URL, "/logout"), {});
5735
+ return httpWithCred.post("".concat(API_URL, "/logout"), {});
5715
5736
  }
5716
5737
 
5717
5738
  /**
@@ -5763,7 +5784,7 @@ function checkFundAccountLogin() {
5763
5784
  });
5764
5785
  });
5765
5786
  }
5766
- return http.get("".concat(API_URL, "/login/fundAccount"));
5787
+ return httpWithCred.get("".concat(API_URL, "/login/fundAccount"));
5767
5788
  }
5768
5789
 
5769
5790
  /**
@@ -5772,7 +5793,7 @@ function checkFundAccountLogin() {
5772
5793
  * @returns {Promise<HttpResponse>}
5773
5794
  */
5774
5795
  function checkMarginAccountLogin() {
5775
- return http.get("".concat(API_URL, "/login/marginAccount"));
5796
+ return httpWithCred.get("".concat(API_URL, "/login/marginAccount"));
5776
5797
  }
5777
5798
 
5778
5799
  /**
@@ -5781,7 +5802,7 @@ function checkMarginAccountLogin() {
5781
5802
  * @returns {Promise<HttpResponse>}
5782
5803
  */
5783
5804
  function checkUserLogin() {
5784
- return http.get("".concat(API_URL, "/login/user"));
5805
+ return httpWithCred.get("".concat(API_URL, "/login/user"));
5785
5806
  }
5786
5807
 
5787
5808
  /**
@@ -5849,7 +5870,7 @@ function bindInfo(data) {
5849
5870
  * @returns {Promise<HttpResponse> }
5850
5871
  */
5851
5872
  function marginAccountLogin(param) {
5852
- return http.post("".concat(API_URL, "/login/marginAccount"), param);
5873
+ return httpWithCred.post("".concat(API_URL, "/login/marginAccount"), param);
5853
5874
  }
5854
5875
 
5855
5876
  /**
@@ -5859,7 +5880,7 @@ function marginAccountLogin(param) {
5859
5880
  * @returns {Promise<HttpResponse>}
5860
5881
  */
5861
5882
  function fundAccountLogin(param) {
5862
- return http.post("".concat(API_URL, "/login/fundAccount"), param);
5883
+ return httpWithCred.post("".concat(API_URL, "/login/fundAccount"), param);
5863
5884
  }
5864
5885
 
5865
5886
  /**
@@ -7424,7 +7445,7 @@ function getWechatUserInfoService(params) {
7424
7445
  * @returns
7425
7446
  */
7426
7447
  function getShortLinkFunc(data) {
7427
- return http.post(API_URL, _assign({
7448
+ return httpWithCred.post(API_URL, _assign({
7428
7449
  UniqueKey: 'serviceName.shortlink.create.remainParam'
7429
7450
  }, data));
7430
7451
  }
@@ -8990,7 +9011,7 @@ var pageInitWithSession = function pageInitWithSession(loginType, URL, needClose
8990
9011
  * @returns {Promise<HttpResponse>}
8991
9012
  */
8992
9013
  function qqStockLogin(param) {
8993
- return http.post("".concat(API_URL, "/login/qqstock"), param);
9014
+ return httpWithCred.post("".concat(API_URL, "/login/qqstock"), param);
8994
9015
  }
8995
9016
 
8996
9017
  function readFile(param) {
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-5FZwaohR.js');
3
+ var index = require('./index-Bx-1fK4R.js');
4
4
  require('ts-md5');
5
5
  require('weixin-js-sdk');
6
6
  require('clipboard');
package/dist/pure.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-5FZwaohR.js');
3
+ var index = require('./index-Bx-1fK4R.js');
4
4
  require('ts-md5');
5
5
  require('weixin-js-sdk');
6
6
  require('clipboard');
@@ -1,7 +1,7 @@
1
1
  import { __awaiter, __generator } from '../node_modules/tslib/tslib.es6.mjs';
2
2
  import { useHybridLogin, LoginType, LOGOUT_TYPE } from '../utils/const.mjs';
3
3
  import { API_URL } from '../utils/urls.mjs';
4
- import { http } from '../http/index.mjs';
4
+ import httpWithCred from '../http/httpWithCred.mjs';
5
5
  import { syncLoginStatusBetweenNativeAndServer } from '../syncLoginStatusBetweenNativeAndServer/index.mjs';
6
6
  import { checkFundAccountLoginFromServer } from '../utils/loginFuncs.mjs';
7
7
  import { decrypt } from '../utils/funcs.mjs';
@@ -57,7 +57,7 @@ function checkFundAccountLogin() {
57
57
  });
58
58
  });
59
59
  }
60
- return http.get("".concat(API_URL, "/login/fundAccount"));
60
+ return httpWithCred.get("".concat(API_URL, "/login/fundAccount"));
61
61
  }
62
62
 
63
63
  export { checkFundAccountLogin };
@@ -1,5 +1,5 @@
1
1
  import { API_URL } from '../utils/urls.mjs';
2
- import { http } from '../http/index.mjs';
2
+ import httpWithCred from '../http/httpWithCred.mjs';
3
3
 
4
4
  /**
5
5
  * marginAccount登录状态检查
@@ -7,7 +7,7 @@ import { http } from '../http/index.mjs';
7
7
  * @returns {Promise<HttpResponse>}
8
8
  */
9
9
  function checkMarginAccountLogin() {
10
- return http.get("".concat(API_URL, "/login/marginAccount"));
10
+ return httpWithCred.get("".concat(API_URL, "/login/marginAccount"));
11
11
  }
12
12
 
13
13
  export { checkMarginAccountLogin };
@@ -1,5 +1,5 @@
1
1
  import { API_URL } from '../utils/urls.mjs';
2
- import { http } from '../http/index.mjs';
2
+ import httpWithCred from '../http/httpWithCred.mjs';
3
3
 
4
4
  /**
5
5
  * user登录状态检查
@@ -7,7 +7,7 @@ import { http } from '../http/index.mjs';
7
7
  * @returns {Promise<HttpResponse>}
8
8
  */
9
9
  function checkUserLogin() {
10
- return http.get("".concat(API_URL, "/login/user"));
10
+ return httpWithCred.get("".concat(API_URL, "/login/user"));
11
11
  }
12
12
 
13
13
  export { checkUserLogin };
@@ -1,5 +1,5 @@
1
1
  import { API_URL } from '../utils/urls.mjs';
2
- import { http } from '../http/index.mjs';
2
+ import httpWithCred from '../http/httpWithCred.mjs';
3
3
 
4
4
  /**
5
5
  * fundaccount登录
@@ -8,7 +8,7 @@ import { http } from '../http/index.mjs';
8
8
  * @returns {Promise<HttpResponse>}
9
9
  */
10
10
  function fundAccountLogin(param) {
11
- return http.post("".concat(API_URL, "/login/fundAccount"), param);
11
+ return httpWithCred.post("".concat(API_URL, "/login/fundAccount"), param);
12
12
  }
13
13
 
14
14
  export { fundAccountLogin };
@@ -0,0 +1,25 @@
1
+ import { __assign as _assign } from '../node_modules/tslib/tslib.es6.mjs';
2
+ import { http } from './index.mjs';
3
+
4
+ // 封装支持跨域cookie共享的http函数
5
+ var httpWithCred = {
6
+ get: function get(url, params) {
7
+ return params && Object.keys(params).length > 0 ? http.get(url, _assign(_assign({}, params), {
8
+ withCredentials: true
9
+ })) : http.get(url, {
10
+ withCredentials: true
11
+ });
12
+ },
13
+ post: function post(url, data) {
14
+ return http.post(url, data, {
15
+ withCredentials: true
16
+ });
17
+ },
18
+ patch: function patch(url, data) {
19
+ return http.patch(url, data, {
20
+ withCredentials: true
21
+ });
22
+ }
23
+ };
24
+
25
+ export { httpWithCred as default };
@@ -1,5 +1,5 @@
1
1
  import { API_URL } from '../utils/urls.mjs';
2
- import { http } from '../http/index.mjs';
2
+ import httpWithCred from '../http/httpWithCred.mjs';
3
3
 
4
4
  /**
5
5
  * 登出
@@ -9,9 +9,9 @@ import { http } from '../http/index.mjs';
9
9
  */
10
10
  function logoutForWeb(loginType) {
11
11
  if (loginType) {
12
- return http.post("".concat(API_URL, "/logout/").concat(loginType));
12
+ return httpWithCred.post("".concat(API_URL, "/logout/").concat(loginType));
13
13
  }
14
- return http.post("".concat(API_URL, "/logout"), {});
14
+ return httpWithCred.post("".concat(API_URL, "/logout"), {});
15
15
  }
16
16
 
17
17
  export { logoutForWeb };
@@ -1,5 +1,5 @@
1
1
  import { API_URL } from '../utils/urls.mjs';
2
- import { http } from '../http/index.mjs';
2
+ import httpWithCred from '../http/httpWithCred.mjs';
3
3
 
4
4
  /**
5
5
  * marginAccount登录
@@ -8,7 +8,7 @@ import { http } from '../http/index.mjs';
8
8
  * @returns {Promise<HttpResponse> }
9
9
  */
10
10
  function marginAccountLogin(param) {
11
- return http.post("".concat(API_URL, "/login/marginAccount"), param);
11
+ return httpWithCred.post("".concat(API_URL, "/login/marginAccount"), param);
12
12
  }
13
13
 
14
14
  export { marginAccountLogin };
@@ -1,11 +1,11 @@
1
1
  import { API_URL } from '../utils/urls.mjs';
2
- import { http } from '../http/index.mjs';
2
+ import httpWithCred from '../http/httpWithCred.mjs';
3
3
 
4
4
  /**
5
5
  * multiLogin 功能组件
6
6
  */
7
7
  function multiLogin(param) {
8
- return http.post("".concat(API_URL, "/login/multi"), param);
8
+ return httpWithCred.post("".concat(API_URL, "/login/multi"), param);
9
9
  }
10
10
 
11
11
  export { multiLogin };
@@ -1,5 +1,5 @@
1
1
  import { API_URL } from '../utils/urls.mjs';
2
- import { http } from '../http/index.mjs';
2
+ import httpWithCred from '../http/httpWithCred.mjs';
3
3
 
4
4
  /**
5
5
  * yjb3.0-passportId登录-phpsession状态同步
@@ -8,7 +8,7 @@ import { http } from '../http/index.mjs';
8
8
  * @returns {Promise<HttpResponse>}
9
9
  */
10
10
  function pidLogin(param) {
11
- return http.post("".concat(API_URL, "/login/passport"), param);
11
+ return httpWithCred.post("".concat(API_URL, "/login/passport"), param);
12
12
  }
13
13
 
14
14
  export { pidLogin };
@@ -1,5 +1,5 @@
1
1
  import { API_URL } from '../utils/urls.mjs';
2
- import { http } from '../http/index.mjs';
2
+ import httpWithCred from '../http/httpWithCred.mjs';
3
3
 
4
4
  /**
5
5
  * 腾讯自选股渠道,session_id登录
@@ -8,7 +8,7 @@ import { http } from '../http/index.mjs';
8
8
  * @returns {Promise<HttpResponse>}
9
9
  */
10
10
  function qqStockLogin(param) {
11
- return http.post("".concat(API_URL, "/login/qqstock"), param);
11
+ return httpWithCred.post("".concat(API_URL, "/login/qqstock"), param);
12
12
  }
13
13
 
14
14
  export { qqStockLogin };
@@ -1,5 +1,5 @@
1
1
  import { API_URL } from '../utils/urls.mjs';
2
- import { http } from '../http/index.mjs';
2
+ import httpWithCred from '../http/httpWithCred.mjs';
3
3
 
4
4
  /**
5
5
  * yjb3.0-user登录-phpsession状态同步
@@ -8,7 +8,7 @@ import { http } from '../http/index.mjs';
8
8
  * @returns {Promise<HttpResponse>}
9
9
  */
10
10
  function userLoginForWeb(param) {
11
- return http.post("".concat(API_URL, "/login/user"), param);
11
+ return httpWithCred.post("".concat(API_URL, "/login/user"), param);
12
12
  }
13
13
 
14
14
  export { userLoginForWeb };
@@ -1,5 +1,6 @@
1
1
  import { __awaiter, __generator, __assign as _assign } from '../node_modules/tslib/tslib.es6.mjs';
2
2
  import { http } from '../http/index.mjs';
3
+ import httpWithCred from '../http/httpWithCred.mjs';
3
4
  import { wechatUserInfoDomain, wechatAuthDomain, API_URL } from './urls.mjs';
4
5
 
5
6
  function getWechatAuthUrl(params) {
@@ -23,7 +24,7 @@ function getWechatUserInfoService(params) {
23
24
  * @returns
24
25
  */
25
26
  function getShortLinkFunc(data) {
26
- return http.post(API_URL, _assign({
27
+ return httpWithCred.post(API_URL, _assign({
27
28
  UniqueKey: 'serviceName.shortlink.create.remainParam'
28
29
  }, data));
29
30
  }
@@ -1,5 +1,5 @@
1
1
  import { __awaiter, __generator, __assign as _assign } from '../node_modules/tslib/tslib.es6.mjs';
2
- import { http } from '../http/index.mjs';
2
+ import httpWithCred from '../http/httpWithCred.mjs';
3
3
  import { API_URL } from './urls.mjs';
4
4
  import { LoginType, NO_TOKEN, MESSAGE, CHANNELID, ALL_NO_SYSTEM_PARAM_KEYS, DEFAULT_RESPONSE } from './const.mjs';
5
5
  import { getUserUKeysByChannelId } from '../getUserUKeysByChannelId/index.mjs';
@@ -18,7 +18,7 @@ function readHybridNoSystemParam$1() {
18
18
  });
19
19
  }
20
20
  function checkFundAccountLoginFromServer() {
21
- return http.get(API_URL + '/login/fundAccount');
21
+ return httpWithCred.get(API_URL + '/login/fundAccount');
22
22
  }
23
23
  //委托客户端请求yjbapi
24
24
  function fetchYJBAPI(param_1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjzq/sdk",
3
- "version": "1.6.0-beta.3",
3
+ "version": "1.6.0-beta.5",
4
4
  "main": "dist/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -62,6 +62,7 @@
62
62
  "@typescript-eslint/eslint-plugin": "^8.46.2",
63
63
  "@typescript-eslint/parser": "^8.46.2",
64
64
  "@umijs/lint": "^4.0.0",
65
+ "axios": "^1.12.2",
65
66
  "cross-env": "^10.1.0",
66
67
  "dumi": "^2.4.21",
67
68
  "dumi-theme-antd-style": "^0.31.1",
@@ -93,7 +94,6 @@
93
94
  "@rollup/plugin-node-resolve": "^16.0.1",
94
95
  "@rollup/plugin-typescript": "^12.1.4",
95
96
  "@testing-library/jest-dom": "^6.9.1",
96
- "axios": "^1.12.2",
97
97
  "clipboard": "^2.0.11",
98
98
  "crypto-js": "^4.2.0",
99
99
  "esbuild": "^0.25.11",