@gjzq/sdk 1.3.1-beta.1 → 1.4.0-beta.2

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.
@@ -285,36 +285,6 @@ var envRules = {
285
285
  ]
286
286
  };
287
287
 
288
- /**
289
- * ready 功能组件
290
- */
291
- function ready() {
292
- return __awaiter(this, void 0, void 0, function () {
293
- return __generator(this, function (_a) {
294
- if (!window.deviceReady) {
295
- window.deviceReady = deviceReady;
296
- }
297
- return [2 /*return*/, new Promise(function (resolve) {
298
- //如果已有桥接对象,直接resovle;如果没有桥接对象,注册监听
299
- if (isBridgeReady()) {
300
- resolve({
301
- value: undefined
302
- });
303
- } else {
304
- // TODO 好像没啥用
305
- document.addEventListener('deviceready', function () {
306
- if (window.webkit.messageHandlers.yjbInterface || window.yjbInterface) {
307
- resolve({
308
- value: undefined
309
- });
310
- }
311
- }, false);
312
- }
313
- })];
314
- });
315
- });
316
- }
317
-
318
288
  /**
319
289
  * 判断一个值是否是函数
320
290
  * @param value 任意值
@@ -524,67 +494,6 @@ var getSysTimeDomain = function getSysTimeDomain() {
524
494
  function isWeixinClient() {
525
495
  return !!navigator.userAgent.match(/MicroMessenger/i);
526
496
  }
527
- /**
528
- * hybrid 读取非系统参数
529
- * @param keys
530
- * @returns
531
- */
532
- function readHybridNoSystemParam() {
533
- return __awaiter(this, arguments, void 0, function (keys) {
534
- if (keys === void 0) {
535
- keys = ALL_NO_SYSTEM_PARAM_KEYS;
536
- }
537
- return __generator(this, function (_a) {
538
- switch (_a.label) {
539
- case 0:
540
- return [4 /*yield*/, ready()];
541
- case 1:
542
- _a.sent();
543
- return [2 /*return*/, nativeIOOperation(4004, {
544
- keys: keys
545
- })];
546
- }
547
- });
548
- });
549
- }
550
- /**
551
- * hybrid 读取系统参数,native异常时,返回空对象
552
- * @param keys
553
- * @returns
554
- */
555
- function readHybridSystemParamIgnoreError(keys) {
556
- var _this = this;
557
- if (keys === void 0) {
558
- keys = ALL_NO_SYSTEM_PARAM_KEYS;
559
- }
560
- return new Promise(function (resolve, reject) {
561
- return __awaiter(_this, void 0, void 0, function () {
562
- var nonSystemParamRes;
563
- return __generator(this, function (_a) {
564
- switch (_a.label) {
565
- case 0:
566
- return [4 /*yield*/, readHybridNoSystemParam(keys)];
567
- case 1:
568
- nonSystemParamRes = _a.sent();
569
- if (nonSystemParamRes.code != 0) {
570
- resolve && resolve({
571
- code: 0,
572
- result: {},
573
- message: nonSystemParamRes.message || MESSAGE.NATIVE_ERROR
574
- });
575
- } else {
576
- resolve && resolve({
577
- code: 0,
578
- result: nonSystemParamRes.result,
579
- message: MESSAGE.SUCCESS
580
- });
581
- }
582
- return [2 /*return*/];
583
- }
584
- });
585
- });
586
- });
587
- }
588
497
  /**
589
498
  * 判断是否是iframe嵌套环境
590
499
  * @returns 是否是iframe嵌套环境
@@ -678,6 +587,36 @@ function exec(_a) {
678
587
  }
679
588
  }
680
589
 
590
+ /**
591
+ * ready 功能组件
592
+ */
593
+ function ready() {
594
+ return __awaiter(this, void 0, void 0, function () {
595
+ return __generator(this, function (_a) {
596
+ if (!window.deviceReady) {
597
+ window.deviceReady = deviceReady;
598
+ }
599
+ return [2 /*return*/, new Promise(function (resolve) {
600
+ //如果已有桥接对象,直接resovle;如果没有桥接对象,注册监听
601
+ if (isBridgeReady()) {
602
+ resolve({
603
+ value: undefined
604
+ });
605
+ } else {
606
+ // TODO 好像没啥用
607
+ document.addEventListener('deviceready', function () {
608
+ if (window.webkit.messageHandlers.yjbInterface || window.yjbInterface) {
609
+ resolve({
610
+ value: undefined
611
+ });
612
+ }
613
+ }, false);
614
+ }
615
+ })];
616
+ });
617
+ });
618
+ }
619
+
681
620
  /**
682
621
  * nativeIOOperation 功能组件
683
622
  */
@@ -865,11 +804,10 @@ var checkLogin = function checkLogin(loginType, channelId) {
865
804
  code: 0,
866
805
  result: userKey
867
806
  }];
868
- } else {
869
- return [2 /*return*/, {
870
- code: -1
871
- }];
872
807
  }
808
+ return [2 /*return*/, {
809
+ code: -1
810
+ }];
873
811
  case 3:
874
812
  if (!(loginType === 'p')) return [3 /*break*/, 5];
875
813
  return [4 /*yield*/, getUkeyByChannelId(channelId)];
@@ -880,11 +818,10 @@ var checkLogin = function checkLogin(loginType, channelId) {
880
818
  code: 0,
881
819
  result: uKey
882
820
  }];
883
- } else {
884
- return [2 /*return*/, {
885
- code: -1
886
- }];
887
821
  }
822
+ return [2 /*return*/, {
823
+ code: -1
824
+ }];
888
825
  case 5:
889
826
  if (!(+loginType === 1)) return [3 /*break*/, 7];
890
827
  return [4 /*yield*/, getLoginStatus()];
@@ -894,11 +831,10 @@ var checkLogin = function checkLogin(loginType, channelId) {
894
831
  return [2 /*return*/, {
895
832
  code: 0
896
833
  }];
897
- } else {
898
- return [2 /*return*/, {
899
- code: -1
900
- }];
901
834
  }
835
+ return [2 /*return*/, {
836
+ code: -1
837
+ }];
902
838
  case 7:
903
839
  if (!(+loginType === 2)) return [3 /*break*/, 9];
904
840
  return [4 /*yield*/, getLoginStatus()];
@@ -908,11 +844,10 @@ var checkLogin = function checkLogin(loginType, channelId) {
908
844
  return [2 /*return*/, {
909
845
  code: 0
910
846
  }];
911
- } else {
912
- return [2 /*return*/, {
913
- code: -1
914
- }];
915
847
  }
848
+ return [2 /*return*/, {
849
+ code: -1
850
+ }];
916
851
  case 9:
917
852
  return [3 /*break*/, 11];
918
853
  case 10:
@@ -5393,7 +5328,7 @@ http.interceptors.response.use(parseResponseMiddleware);
5393
5328
  * @returns {Promise<HttpResponse>}
5394
5329
  */
5395
5330
  function userLoginForWeb(param) {
5396
- return http.post(API_URL + '/login/user', param);
5331
+ return http.post("".concat(API_URL, "/login/user"), param);
5397
5332
  }
5398
5333
 
5399
5334
  /**
@@ -5406,6 +5341,18 @@ function pidLogin(param) {
5406
5341
  return http.post("".concat(API_URL, "/login/passport"), param);
5407
5342
  }
5408
5343
 
5344
+ function readHybridNoSystemParam$1() {
5345
+ return __awaiter(this, arguments, void 0, function (keys) {
5346
+ if (keys === void 0) {
5347
+ keys = ALL_NO_SYSTEM_PARAM_KEYS;
5348
+ }
5349
+ return __generator(this, function (_a) {
5350
+ return [2 /*return*/, nativeIOOperation(4004, {
5351
+ keys: keys
5352
+ })];
5353
+ });
5354
+ });
5355
+ }
5409
5356
  function checkFundAccountLoginFromServer() {
5410
5357
  return http.get(API_URL + '/login/fundAccount');
5411
5358
  }
@@ -5426,13 +5373,10 @@ function fetchYJBAPI(param_1) {
5426
5373
  return __generator(this, function (_a) {
5427
5374
  switch (_a.label) {
5428
5375
  case 0:
5429
- return [4 /*yield*/, ready()];
5430
- case 1:
5431
- _a.sent();
5432
5376
  return [4 /*yield*/, nativeIOOperation(1001, Object.assign({}, options, {
5433
5377
  param: param
5434
5378
  }))];
5435
- case 2:
5379
+ case 1:
5436
5380
  nativeResponse = _a.sent();
5437
5381
  if (nativeResponse.code != 0) {
5438
5382
  //客户端调用失败或网络错误
@@ -5499,7 +5443,7 @@ function getFundAccountTokenForHybrid() {
5499
5443
  return __generator(this, function (_a) {
5500
5444
  switch (_a.label) {
5501
5445
  case 0:
5502
- return [4 /*yield*/, readHybridNoSystemParam(['fundAccount', 'opStation'])];
5446
+ return [4 /*yield*/, readHybridNoSystemParam$1(['fundAccount', 'opStation'])];
5503
5447
  case 1:
5504
5448
  nonSystemParamRes = _a.sent();
5505
5449
  if (nonSystemParamRes.code != 0) {
@@ -5626,6 +5570,9 @@ function multiLogin(param) {
5626
5570
  return http.post("".concat(API_URL, "/login/multi"), param);
5627
5571
  }
5628
5572
 
5573
+ /* eslint-disable @typescript-eslint/no-unused-vars */
5574
+ /* eslint-disable @typescript-eslint/no-unused-expressions */
5575
+ /* eslint-disable no-async-promise-executor */
5629
5576
  /**
5630
5577
  * 客户端与服务端登录态同步
5631
5578
  * @function syncLoginStatusBetweenNativeAndServer
@@ -5642,7 +5589,7 @@ function syncLoginStatusBetweenNativeAndServer(syncLoginTypes) {
5642
5589
  return __generator(this, function (_b) {
5643
5590
  switch (_b.label) {
5644
5591
  case 0:
5645
- console.log("syncLoginTypes", syncLoginTypes);
5592
+ console.log('syncLoginTypes', syncLoginTypes);
5646
5593
  getLoginParamPromises = [];
5647
5594
  if (syncLoginTypes.includes(LoginType.FUNDACCOUNT)) {
5648
5595
  getLoginParamPromises.push(getFundAccountTokenForHybrid());
@@ -5681,6 +5628,62 @@ function syncLoginStatusBetweenNativeAndServer(syncLoginTypes) {
5681
5628
  });
5682
5629
  }
5683
5630
 
5631
+ /**
5632
+ * hybrid 读取非系统参数
5633
+ * @param keys
5634
+ * @returns
5635
+ */
5636
+ function readHybridNoSystemParam() {
5637
+ return __awaiter(this, arguments, void 0, function (keys) {
5638
+ if (keys === void 0) {
5639
+ keys = ALL_NO_SYSTEM_PARAM_KEYS;
5640
+ }
5641
+ return __generator(this, function (_a) {
5642
+ return [2 /*return*/, nativeIOOperation(4004, {
5643
+ keys: keys
5644
+ })];
5645
+ });
5646
+ });
5647
+ }
5648
+ /**
5649
+ * hybrid 读取系统参数,native异常时,返回空对象
5650
+ * @param keys
5651
+ * @returns
5652
+ */
5653
+ function readHybridSystemParamIgnoreError(keys) {
5654
+ var _this = this;
5655
+ if (keys === void 0) {
5656
+ keys = ALL_NO_SYSTEM_PARAM_KEYS;
5657
+ }
5658
+ return new Promise(function (resolve, reject) {
5659
+ return __awaiter(_this, void 0, void 0, function () {
5660
+ var nonSystemParamRes;
5661
+ return __generator(this, function (_a) {
5662
+ switch (_a.label) {
5663
+ case 0:
5664
+ return [4 /*yield*/, readHybridNoSystemParam(keys)];
5665
+ case 1:
5666
+ nonSystemParamRes = _a.sent();
5667
+ if (nonSystemParamRes.code != 0) {
5668
+ resolve && resolve({
5669
+ code: 0,
5670
+ result: {},
5671
+ message: nonSystemParamRes.message || MESSAGE.NATIVE_ERROR
5672
+ });
5673
+ } else {
5674
+ resolve && resolve({
5675
+ code: 0,
5676
+ result: nonSystemParamRes.result,
5677
+ message: MESSAGE.SUCCESS
5678
+ });
5679
+ }
5680
+ return [2 /*return*/];
5681
+ }
5682
+ });
5683
+ });
5684
+ });
5685
+ }
5686
+
5684
5687
  /**
5685
5688
  * 登出
5686
5689
  * @function logout
@@ -5689,10 +5692,9 @@ function syncLoginStatusBetweenNativeAndServer(syncLoginTypes) {
5689
5692
  */
5690
5693
  function logoutForWeb(loginType) {
5691
5694
  if (loginType) {
5692
- return http.post(API_URL + "/logout/".concat(loginType));
5693
- } else {
5694
- return http.post(API_URL + '/logout', {});
5695
+ return http.post("".concat(API_URL, "/logout/").concat(loginType));
5695
5696
  }
5697
+ return http.post("".concat(API_URL, "/logout"), {});
5696
5698
  }
5697
5699
 
5698
5700
  /**
@@ -5716,9 +5718,9 @@ function checkFundAccountLogin() {
5716
5718
  if (!!nativeFundAccount) return [3 /*break*/, 2];
5717
5719
  logoutForWeb(LOGOUT_TYPE.FUNDACCOUNT);
5718
5720
  resolve && resolve({
5719
- "code": -1,
5720
- "message": "login fail!",
5721
- "data": ""
5721
+ 'code': -1,
5722
+ 'message': 'login fail!',
5723
+ 'data': ''
5722
5724
  }); //todo
5723
5725
  return [3 /*break*/, 7];
5724
5726
  case 2:
@@ -5743,9 +5745,8 @@ function checkFundAccountLogin() {
5743
5745
  });
5744
5746
  });
5745
5747
  });
5746
- } else {
5747
- return http.get(API_URL + '/login/fundAccount');
5748
5748
  }
5749
+ return http.get("".concat(API_URL, "/login/fundAccount"));
5749
5750
  }
5750
5751
 
5751
5752
  /**
@@ -5754,7 +5755,7 @@ function checkFundAccountLogin() {
5754
5755
  * @returns {Promise<HttpResponse>}
5755
5756
  */
5756
5757
  function checkMarginAccountLogin() {
5757
- return http.get(API_URL + '/login/marginAccount');
5758
+ return http.get("".concat(API_URL, "/login/marginAccount"));
5758
5759
  }
5759
5760
 
5760
5761
  /**
@@ -5763,7 +5764,7 @@ function checkMarginAccountLogin() {
5763
5764
  * @returns {Promise<HttpResponse>}
5764
5765
  */
5765
5766
  function checkUserLogin() {
5766
- return http.get(API_URL + '/login/user');
5767
+ return http.get("".concat(API_URL, "/login/user"));
5767
5768
  }
5768
5769
 
5769
5770
  /**
@@ -5831,7 +5832,7 @@ function bindInfo(data) {
5831
5832
  * @returns {Promise<HttpResponse> }
5832
5833
  */
5833
5834
  function marginAccountLogin(param) {
5834
- return http.post(API_URL + '/login/marginAccount', param);
5835
+ return http.post("".concat(API_URL, "/login/marginAccount"), param);
5835
5836
  }
5836
5837
 
5837
5838
  /**
@@ -5841,7 +5842,7 @@ function marginAccountLogin(param) {
5841
5842
  * @returns {Promise<HttpResponse>}
5842
5843
  */
5843
5844
  function fundAccountLogin(param) {
5844
- return http.post(API_URL + '/login/fundAccount', param);
5845
+ return http.post("".concat(API_URL, "/login/fundAccount"), param);
5845
5846
  }
5846
5847
 
5847
5848
  /**
@@ -6236,7 +6237,7 @@ function getActionRedirectOptions(config) {
6236
6237
  */
6237
6238
  function loginWithToken() {
6238
6239
  return __awaiter(this, void 0, void 0, function () {
6239
- var accountType, instantToken, oldInstantToken, opStation, _a, code, data, _b, code, data;
6240
+ var accountType, instantToken, oldInstantToken, opStation, _a, code_1, data_1, _b, code, data;
6240
6241
  return __generator(this, function (_c) {
6241
6242
  switch (_c.label) {
6242
6243
  case 0:
@@ -6265,9 +6266,9 @@ function loginWithToken() {
6265
6266
  instant_token: instantToken
6266
6267
  })];
6267
6268
  case 1:
6268
- _a = _c.sent(), code = _a.code, data = _a.data;
6269
- bindInfo(data);
6270
- return [2 /*return*/, code === 0];
6269
+ _a = _c.sent(), code_1 = _a.code, data_1 = _a.data;
6270
+ bindInfo(data_1);
6271
+ return [2 /*return*/, code_1 === 0];
6271
6272
  case 2:
6272
6273
  return [4 /*yield*/, fundAccountLogin({
6273
6274
  op_station: opStation,
@@ -6284,7 +6285,7 @@ function loginWithToken() {
6284
6285
 
6285
6286
  function loginWithTokenForWeb(loginType) {
6286
6287
  return __awaiter(this, void 0, void 0, function () {
6287
- var accountType, instantToken, oldInstantToken, fundAccountLoginResult, marginAccountLoginResult, opStation, _a, code, data, _b, code, data;
6288
+ var accountType, instantToken, oldInstantToken, fundAccountLoginResult, marginAccountLoginResult, opStation, _a, code_1, data_1, _b, code, data;
6288
6289
  return __generator(this, function (_c) {
6289
6290
  switch (_c.label) {
6290
6291
  case 0:
@@ -6300,10 +6301,9 @@ function loginWithTokenForWeb(loginType) {
6300
6301
  // 2025.01.02 经讨论 退登不解绑!!
6301
6302
  // bindInfo({ pid: null, clientId: null })
6302
6303
  return [2 /*return*/, false];
6303
- } else {
6304
- bindInfo(fundAccountLoginResult.data);
6305
- return [2 /*return*/, true];
6306
6304
  }
6305
+ bindInfo(fundAccountLoginResult.data);
6306
+ return [2 /*return*/, true];
6307
6307
  case 2:
6308
6308
  if (!(loginType === LoginType.MARGINACCOUNT)) return [3 /*break*/, 4];
6309
6309
  return [4 /*yield*/, checkMarginAccountLogin()];
@@ -6313,14 +6313,15 @@ function loginWithTokenForWeb(loginType) {
6313
6313
  // 2025.01.02 经讨论 退登不解绑!!
6314
6314
  // bindInfo({ pid: null, clientId: null })
6315
6315
  return [2 /*return*/, false];
6316
- } else {
6317
- bindInfo(marginAccountLoginResult.data);
6318
- return [2 /*return*/, true];
6319
6316
  }
6317
+ bindInfo(marginAccountLoginResult.data);
6318
+ return [2 /*return*/, true];
6320
6319
  case 4:
6321
6320
  return [3 /*break*/, 6];
6322
6321
  case 5:
6323
- instantToken !== 'notoken' ? localStorage.setItem('instant_token', instantToken) : null;
6322
+ if (instantToken && instantToken !== 'notoken') {
6323
+ localStorage.setItem('instant_token', instantToken);
6324
+ }
6324
6325
  _c.label = 6;
6325
6326
  case 6:
6326
6327
  opStation = getQueryString('op_station');
@@ -6336,9 +6337,9 @@ function loginWithTokenForWeb(loginType) {
6336
6337
  instant_token: instantToken
6337
6338
  })];
6338
6339
  case 7:
6339
- _a = _c.sent(), code = _a.code, data = _a.data;
6340
- bindInfo(data);
6341
- return [2 /*return*/, code === 0];
6340
+ _a = _c.sent(), code_1 = _a.code, data_1 = _a.data;
6341
+ bindInfo(data_1);
6342
+ return [2 /*return*/, code_1 === 0];
6342
6343
  case 8:
6343
6344
  return [4 /*yield*/, fundAccountLogin({
6344
6345
  op_station: opStation,
@@ -6361,17 +6362,17 @@ function loginWithTokenForWeb(loginType) {
6361
6362
  */
6362
6363
  function checkLoginForWeb(loginType) {
6363
6364
  return __awaiter(this, void 0, void 0, function () {
6364
- var checkResult, key, param, loginResult, param, loginResult, param, loginResult, fundAccountLoginResult, param, loginResult, instantToken, fundAccountLoginResult, param, loginResult, instantToken, marginAccountLoginResult, userLoginResult;
6365
+ var checkResult, key, param, loginResult, param, loginResult, param_1, loginResult_1, fundAccountLoginResult_1, param, loginResult, instantToken, fundAccountLoginResult, param, loginResult, instantToken, marginAccountLoginResult, userLoginResult;
6365
6366
  return __generator(this, function (_a) {
6366
6367
  switch (_a.label) {
6367
6368
  case 0:
6368
6369
  return [4 /*yield*/, getAppId()];
6369
6370
  case 1:
6370
- if (!(_a.sent() === 'yjb3.0')) return [3 /*break*/, 28];
6371
+ if (!(_a.sent() === 'yjb3.0')) return [3 /*break*/, 25];
6371
6372
  return [4 /*yield*/, checkLogin(loginType, CHANNELID)];
6372
6373
  case 2:
6373
6374
  checkResult = _a.sent();
6374
- if (!(checkResult.code === 0)) return [3 /*break*/, 26];
6375
+ if (!(checkResult.code === 0)) return [3 /*break*/, 23];
6375
6376
  key = checkResult.result;
6376
6377
  if (!(loginType === LoginType.USER)) return [3 /*break*/, 4];
6377
6378
  param = {
@@ -6387,11 +6388,10 @@ function checkLoginForWeb(loginType) {
6387
6388
  // 解绑userId
6388
6389
  // bindInfo({ userId: null, YJB_userId: 'DEFAULT' });
6389
6390
  return [2 /*return*/, false];
6390
- } else {
6391
- // 绑userId
6392
- bindInfo(loginResult.data);
6393
- return [2 /*return*/, true];
6394
6391
  }
6392
+ // 绑userId
6393
+ bindInfo(loginResult.data);
6394
+ return [2 /*return*/, true];
6395
6395
  case 4:
6396
6396
  if (!(loginType === LoginType.PASSPORT)) return [3 /*break*/, 6];
6397
6397
  param = {
@@ -6406,33 +6406,32 @@ function checkLoginForWeb(loginType) {
6406
6406
  // 解绑pid
6407
6407
  // bindInfo({ pid: null })
6408
6408
  return [2 /*return*/, false];
6409
- } else {
6410
- bindInfo(loginResult.data);
6411
- return [2 /*return*/, true];
6412
6409
  }
6410
+ bindInfo(loginResult.data);
6411
+ return [2 /*return*/, true];
6413
6412
  case 6:
6414
- if (!(loginType === LoginType.FUNDACCOUNT)) return [3 /*break*/, 17];
6413
+ if (!(loginType === LoginType.FUNDACCOUNT)) return [3 /*break*/, 16];
6415
6414
  if (!useHybridLogin()) return [3 /*break*/, 10];
6416
6415
  return [4 /*yield*/, getUkeyByChannelId(CHANNELID)];
6417
6416
  case 7:
6418
6417
  key = _a.sent();
6419
- param = {
6418
+ param_1 = {
6420
6419
  channelId: CHANNELID,
6421
6420
  uKey: key
6422
6421
  };
6423
- return [4 /*yield*/, pidLogin(param)];
6422
+ return [4 /*yield*/, pidLogin(param_1)];
6424
6423
  case 8:
6425
- loginResult = _a.sent();
6426
- if (loginResult.code !== 0) {
6424
+ loginResult_1 = _a.sent();
6425
+ if (loginResult_1.code !== 0) {
6427
6426
  // 2025.01.02 经讨论 退登不解绑!!
6428
6427
  // bindInfo({ pid: null, clientId: null })
6429
6428
  return [2 /*return*/, false];
6430
6429
  }
6431
6430
  return [4 /*yield*/, checkFundAccountLogin()];
6432
6431
  case 9:
6433
- fundAccountLoginResult = _a.sent();
6434
- bindInfo(fundAccountLoginResult.data);
6435
- return [2 /*return*/, fundAccountLoginResult.code == 0];
6432
+ fundAccountLoginResult_1 = _a.sent();
6433
+ bindInfo(fundAccountLoginResult_1.data);
6434
+ return [2 /*return*/, fundAccountLoginResult_1.code == 0];
6436
6435
  case 10:
6437
6436
  return [4 /*yield*/, getUkeyByChannelId(CHANNELID)];
6438
6437
  case 11:
@@ -6462,18 +6461,16 @@ function checkLoginForWeb(loginType) {
6462
6461
  bindInfo(fundAccountLoginResult.data);
6463
6462
  return [2 /*return*/, fundAccountLoginResult.code == 0];
6464
6463
  case 16:
6465
- return [3 /*break*/, 25];
6466
- case 17:
6467
- if (!(loginType === LoginType.MARGINACCOUNT)) return [3 /*break*/, 24];
6464
+ if (!(loginType === LoginType.MARGINACCOUNT)) return [3 /*break*/, 22];
6468
6465
  return [4 /*yield*/, getUkeyByChannelId(CHANNELID)];
6469
- case 18:
6466
+ case 17:
6470
6467
  key = _a.sent();
6471
6468
  param = {
6472
6469
  channelId: CHANNELID,
6473
6470
  uKey: key
6474
6471
  };
6475
6472
  return [4 /*yield*/, pidLogin(param)];
6476
- case 19:
6473
+ case 18:
6477
6474
  loginResult = _a.sent();
6478
6475
  if (loginResult.code !== 0) {
6479
6476
  // 2025.01.02 经讨论 退登不解绑!!
@@ -6481,46 +6478,41 @@ function checkLoginForWeb(loginType) {
6481
6478
  return [2 /*return*/, false];
6482
6479
  }
6483
6480
  instantToken = getQueryString('instant_token');
6484
- if (!instantToken) return [3 /*break*/, 21];
6481
+ if (!instantToken) return [3 /*break*/, 20];
6485
6482
  return [4 /*yield*/, loginWithToken()];
6486
- case 20:
6483
+ case 19:
6487
6484
  return [2 /*return*/, _a.sent()];
6488
- case 21:
6485
+ case 20:
6489
6486
  return [4 /*yield*/, checkMarginAccountLogin()];
6490
- case 22:
6487
+ case 21:
6491
6488
  marginAccountLoginResult = _a.sent();
6492
6489
  bindInfo(marginAccountLoginResult.data);
6493
6490
  return [2 /*return*/, marginAccountLoginResult.code == 0];
6494
- case 23:
6495
- return [3 /*break*/, 25];
6496
- case 24:
6491
+ case 22:
6497
6492
  return [2 /*return*/, false];
6498
- case 25:
6499
- return [3 /*break*/, 27];
6500
- case 26:
6493
+ case 23:
6501
6494
  if (checkResult.code === -2) {
6502
6495
  //客户端系统版本不支持,或app端不支持(微信)
6503
6496
  return [2 /*return*/, false];
6504
- } else {
6505
- //未登录,登录界面返回
6506
- return [2 /*return*/, false];
6507
6497
  }
6508
- case 27:
6509
- return [3 /*break*/, 35];
6510
- case 28:
6511
- if (!(loginType === LoginType.PASSPORT || loginType === LoginType.FUNDACCOUNT)) return [3 /*break*/, 30];
6498
+ _a.label = 24;
6499
+ case 24:
6500
+ //未登录,登录界面返回
6501
+ return [2 /*return*/, false];
6502
+ case 25:
6503
+ if (!(loginType === LoginType.PASSPORT || loginType === LoginType.FUNDACCOUNT)) return [3 /*break*/, 27];
6512
6504
  return [4 /*yield*/, loginWithTokenForWeb(loginType)];
6513
- case 29:
6505
+ case 26:
6514
6506
  return [2 /*return*/, _a.sent()];
6515
- case 30:
6516
- if (!(loginType === LoginType.MARGINACCOUNT)) return [3 /*break*/, 32];
6507
+ case 27:
6508
+ if (!(loginType === LoginType.MARGINACCOUNT)) return [3 /*break*/, 29];
6517
6509
  return [4 /*yield*/, loginWithTokenForWeb(loginType)];
6518
- case 31:
6510
+ case 28:
6519
6511
  return [2 /*return*/, _a.sent()];
6520
- case 32:
6521
- if (!(loginType === LoginType.USER)) return [3 /*break*/, 34];
6512
+ case 29:
6513
+ if (!(loginType === LoginType.USER)) return [3 /*break*/, 31];
6522
6514
  return [4 /*yield*/, checkUserLogin()];
6523
- case 33:
6515
+ case 30:
6524
6516
  userLoginResult = _a.sent();
6525
6517
  console.log('userLoginResult:', userLoginResult);
6526
6518
  // 绑userId
@@ -6528,14 +6520,11 @@ function checkLoginForWeb(loginType) {
6528
6520
  // 2025.01.02 经讨论 退登不解绑!!
6529
6521
  // bindInfo({ userId: null })
6530
6522
  return [2 /*return*/, false];
6531
- } else {
6532
- bindInfo(userLoginResult.data);
6533
- return [2 /*return*/, true];
6534
6523
  }
6535
- case 34:
6524
+ bindInfo(userLoginResult.data);
6525
+ return [2 /*return*/, true];
6526
+ case 31:
6536
6527
  return [2 /*return*/, false];
6537
- case 35:
6538
- return [2 /*return*/];
6539
6528
  }
6540
6529
  });
6541
6530
  });
@@ -6738,41 +6727,38 @@ var beginLogin = function beginLogin(loginType, channelId, json) {
6738
6727
  case 0:
6739
6728
  return [4 /*yield*/, getAppId()];
6740
6729
  case 1:
6741
- if (!(_a.sent() === 'yjb3.0')) return [3 /*break*/, 14];
6730
+ if (!(_a.sent() === 'yjb3.0')) return [3 /*break*/, 11];
6742
6731
  return [4 /*yield*/, checkLogin(loginType, channelId)];
6743
6732
  case 2:
6744
6733
  checkResult = _a.sent();
6745
- if (!(checkResult.code == 0)) return [3 /*break*/, 3];
6746
- return [2 /*return*/, checkResult];
6747
- case 3:
6748
- if (!(checkResult.code == -2)) return [3 /*break*/, 4];
6749
- return [2 /*return*/, {
6750
- code: -2,
6751
- result: 'version not supported'
6752
- }];
6753
- case 4:
6754
- if (!(loginType === 'u')) return [3 /*break*/, 9];
6734
+ if (checkResult.code == 0) {
6735
+ return [2 /*return*/, checkResult];
6736
+ } else if (checkResult.code == -2) {
6737
+ return [2 /*return*/, {
6738
+ code: -2,
6739
+ result: 'version not supported'
6740
+ }];
6741
+ }
6742
+ if (!(loginType === 'u')) return [3 /*break*/, 6];
6755
6743
  return [4 /*yield*/, userLogin(json)];
6756
- case 5:
6744
+ case 3:
6757
6745
  userLoginResult = _a.sent();
6758
- if (!(userLoginResult.code === 0)) return [3 /*break*/, 7];
6746
+ if (!(userLoginResult.code === 0)) return [3 /*break*/, 5];
6759
6747
  if (isIos) {
6760
6748
  //适配ios移动端
6761
6749
  closePage({});
6762
6750
  }
6763
6751
  return [4 /*yield*/, checkLogin(loginType, channelId)];
6764
- case 6:
6752
+ case 4:
6765
6753
  return [2 /*return*/, _a.sent()];
6766
- case 7:
6754
+ case 5:
6767
6755
  //取消登录,需要关闭登录页
6768
6756
  closePage({});
6769
6757
  return [2 /*return*/, {
6770
6758
  code: -3
6771
6759
  }];
6772
- case 8:
6773
- return [3 /*break*/, 13];
6774
- case 9:
6775
- if (!(loginType === 'p' || +loginType === 1 || +loginType === 2)) return [3 /*break*/, 13];
6760
+ case 6:
6761
+ if (!(loginType === 'p' || +loginType === 1 || +loginType === 2)) return [3 /*break*/, 10];
6776
6762
  args = {
6777
6763
  type: +loginType === 2 ? 2 : 1,
6778
6764
  needPassportId: 1,
@@ -6783,29 +6769,29 @@ var beginLogin = function beginLogin(loginType, channelId, json) {
6783
6769
  args.fundAccount = json.fundAccount;
6784
6770
  }
6785
6771
  return [4 /*yield*/, login(args)];
6786
- case 10:
6772
+ case 7:
6787
6773
  loginResult = _a.sent();
6788
- if (!(loginResult.code === 0)) return [3 /*break*/, 12];
6774
+ if (!(loginResult.code === 0)) return [3 /*break*/, 9];
6789
6775
  //普通登录ios 安卓都需要执行关闭页面操作
6790
6776
  closePage({});
6791
6777
  return [4 /*yield*/, checkLogin(loginType, channelId)];
6792
- case 11:
6778
+ case 8:
6793
6779
  return [2 /*return*/, _a.sent()];
6794
- case 12:
6780
+ case 9:
6795
6781
  //取消登录,关闭登录页
6796
6782
  closePage({});
6797
6783
  return [2 /*return*/, {
6798
6784
  code: -3
6799
6785
  }];
6800
- case 13:
6801
- return [3 /*break*/, 15];
6802
- case 14:
6786
+ case 10:
6787
+ return [3 /*break*/, 12];
6788
+ case 11:
6803
6789
  //todo 其他终端还不支持此功能
6804
6790
  return [2 /*return*/, {
6805
6791
  code: -2,
6806
6792
  result: 'app not supported'
6807
6793
  }];
6808
- case 15:
6794
+ case 12:
6809
6795
  return [2 /*return*/];
6810
6796
  }
6811
6797
  });
@@ -8436,6 +8422,7 @@ var CustomURI = /** @class */function () {
8436
8422
  // // 获取完整URL
8437
8423
  // console.log(uri.href()); // 输出修改后的完整URL
8438
8424
 
8425
+ /* eslint-disable @typescript-eslint/no-unused-vars */
8439
8426
  /**
8440
8427
  * v2工具:回流配置转换成v1广告配置,并根据使用场景返回跳转参数对象
8441
8428
  * @function linkDecode
@@ -8471,7 +8458,7 @@ var linkActionDecode = function linkActionDecode(action, config) {
8471
8458
  var str = '';
8472
8459
  if (theRequest) {
8473
8460
  for (var n in theRequest) {
8474
- str = str + "&".concat(n, "=").concat(theRequest[n]);
8461
+ str = "".concat(str, "&").concat(n, "=").concat(theRequest[n]);
8475
8462
  }
8476
8463
  }
8477
8464
  // 针对哈西路由链接,location参数的处理 1-保持,0-移到hash路由(默认)
@@ -8481,7 +8468,9 @@ var linkActionDecode = function linkActionDecode(action, config) {
8481
8468
  str = str.replace('&', '?');
8482
8469
  }
8483
8470
  hashIgnore = param.hashIgnore || 0;
8484
- !+hashIgnore && uri.search("");
8471
+ if (!+hashIgnore) {
8472
+ uri.search('');
8473
+ }
8485
8474
  uri.hash("".concat(commonUrl).concat(str));
8486
8475
  }
8487
8476
  url = decodeURIComponent(uri.href());
@@ -8528,7 +8517,7 @@ var linkDecode = function linkDecode(link, config) {
8528
8517
  var str = '';
8529
8518
  if (other) {
8530
8519
  for (var n in other) {
8531
- str = str + "&".concat(n, "=").concat(other[n]);
8520
+ str = "".concat(str, "&").concat(n, "=").concat(other[n]);
8532
8521
  }
8533
8522
  }
8534
8523
  // 针对哈西路由链接,location参数的处理 1-保持,0-移到hash路由(默认)
@@ -8537,13 +8526,15 @@ var linkDecode = function linkDecode(link, config) {
8537
8526
  if (hashQuery.length == 1) {
8538
8527
  str = str.replace('&', '?');
8539
8528
  }
8540
- !+hashIgnore && uri.search("");
8529
+ if (!+hashIgnore) {
8530
+ uri.search('');
8531
+ }
8541
8532
  uri.hash("".concat(commonUrl).concat(str));
8542
8533
  }
8543
8534
  var url = decodeURIComponent(uri.href());
8544
8535
  var jump = getDataJson(jumpInfo);
8545
8536
  var add = getDataJson(addInfo, true);
8546
- console.log("add:", add);
8537
+ console.log('add:', add);
8547
8538
  var options = {
8548
8539
  url: url,
8549
8540
  hashIgnore: Number(hashIgnore) || 0,
@@ -8737,9 +8728,9 @@ var openApp = function openApp(param) {
8737
8728
  };
8738
8729
 
8739
8730
  //特殊环境情况可通过全局变量修改
8740
- var EVOLUTION_UNIVERSAL_URL = window.EVOLUTION_UNIVERSAL_URL || window.location.toString().indexOf('https://devwebapps.yjbtest.com') > -1 ? "https://linkm.yjbtest.com/download/app-download.html" : "https://linkm.yongjinbao.com.cn/download/app-download.html";
8741
- var EVOLUTION_TXAPP_URL = window.EVOLUTION_TXAPP_URL || "https://a.app.qq.com/o/simple.jsp?pkgname=cn.com.gjzq.yjb2";
8742
- var EVOLUTION_ANDOWNLOAD_URL = window.EVOLUTION_ANDOWNLOAD_URL || "https://appdl.yongjinbao.com.cn/yjb/android/yongjinbao.apk";
8731
+ var EVOLUTION_UNIVERSAL_URL = window.EVOLUTION_UNIVERSAL_URL || window.location.toString().indexOf('https://devwebapps.yjbtest.com') > -1 ? 'https://linkm.yjbtest.com/download/app-download.html' : 'https://linkm.yongjinbao.com.cn/download/app-download.html';
8732
+ var EVOLUTION_TXAPP_URL = window.EVOLUTION_TXAPP_URL || 'https://a.app.qq.com/o/simple.jsp?pkgname=cn.com.gjzq.yjb2';
8733
+ var EVOLUTION_ANDOWNLOAD_URL = window.EVOLUTION_ANDOWNLOAD_URL || 'https://appdl.yongjinbao.com.cn/yjb/android/yongjinbao.apk';
8743
8734
  var EVOLUTION_MINIAPP_URL = window.EVOLUTION_MINIAPP_URL || EVOLUTION_UNIVERSAL_URL;
8744
8735
  /**
8745
8736
  * 跳转至APP下载并传参
@@ -8806,8 +8797,8 @@ var openAppForWeb = function openAppForWeb(selector, config, urlConfig) {
8806
8797
  case 5:
8807
8798
  oConfig = config || {};
8808
8799
  /**
8809
- * 处理可能存在的url中包含多余分享字段
8810
- */
8800
+ * 处理可能存在的url中包含多余分享字段
8801
+ */
8811
8802
  if (oConfig && oConfig.param && oConfig.param.url) {
8812
8803
  url = new CustomURI(oConfig.param.url);
8813
8804
  url.setQuery({
@@ -8820,7 +8811,7 @@ var openAppForWeb = function openAppForWeb(selector, config, urlConfig) {
8820
8811
  try {
8821
8812
  searchParams = new URLSearchParams(location.search);
8822
8813
  shareMarkInfo = encodeURIComponent(searchParams.get('shareMarkInfo') || '');
8823
- } catch (e) {}
8814
+ } catch (e) {/* empty */}
8824
8815
  schemeUrl = "com.yjb.jy://?action=".concat(action);
8825
8816
  if (isIos) {
8826
8817
  //TOTO 地址后面需要灵活配置
@@ -8848,7 +8839,7 @@ var openAppForWeb = function openAppForWeb(selector, config, urlConfig) {
8848
8839
  config = JSON.parse(data);
8849
8840
  if (dataUrl) urlConfig = JSON.parse(dataUrl);
8850
8841
  setConfigParams(config, urlConfig);
8851
- } catch (e) {}
8842
+ } catch (e) {/* empty */}
8852
8843
  }
8853
8844
  return isIos ? 'yjbapp://' : schemeUrl;
8854
8845
  }
@@ -8893,30 +8884,28 @@ var openAppForWeb = function openAppForWeb(selector, config, urlConfig) {
8893
8884
  var url = "".concat(evolution_universal_url).concat(evolution_universal_url.includes('?') ? '&' : '?', "action=").concat(action, "&shareMarkInfo=").concat(shareMarkInfo);
8894
8885
  pageInit(evolution_scene_url ? "".concat(url, "&sceneUrl=").concat(encodeURIComponent(evolution_scene_url)) : "".concat(url), false, {});
8895
8886
  }
8896
- } else {
8897
- if (isAndroid) {
8898
- //原设置为4000
8899
- var t_1 = 1000,
8900
- hasApp_1 = true;
8901
- //设置定时器,判断如果没有呼起app,则调用定时器,跳转下载(至腾讯应用宝 or apk下载)
8902
- setTimeout(function () {
8903
- if (!hasApp_1) {
8904
- var url = evolution_scene_url || (appId === 'insertApp' ? "".concat(evolution_txapp_url, "&android_schema=").concat(encodeURIComponent(schemeUrl)) : evolution_andownload_url);
8905
- pageInit("".concat(url), false, {});
8906
- }
8907
- }, 1500);
8908
- var t1_1 = Date.now();
8909
- window.location.href = schemeUrl;
8910
- setTimeout(function () {
8911
- var t2 = Date.now();
8912
- if (t2 - t1_1 < t_1 + 100) {
8913
- hasApp_1 = false;
8914
- }
8915
- }, t_1);
8916
- } else if (isIos) {
8917
- var url = "".concat(evolution_universal_url).concat(evolution_universal_url.includes('?') ? '&' : '?', "action=").concat(action, "&shareMarkInfo=").concat(shareMarkInfo);
8918
- pageInit(evolution_scene_url ? "".concat(url, "&sceneUrl=").concat(encodeURIComponent(evolution_scene_url)) : "".concat(url), false, {});
8919
- }
8887
+ } else if (isAndroid) {
8888
+ //原设置为4000
8889
+ var t_1 = 1000,
8890
+ hasApp_1 = true;
8891
+ //设置定时器,判断如果没有呼起app,则调用定时器,跳转下载(至腾讯应用宝 or apk下载)
8892
+ setTimeout(function () {
8893
+ if (!hasApp_1) {
8894
+ var url = evolution_scene_url || (appId === 'insertApp' ? "".concat(evolution_txapp_url, "&android_schema=").concat(encodeURIComponent(schemeUrl)) : evolution_andownload_url);
8895
+ pageInit("".concat(url), false, {});
8896
+ }
8897
+ }, 1500);
8898
+ var t1_1 = Date.now();
8899
+ window.location.href = schemeUrl;
8900
+ setTimeout(function () {
8901
+ var t2 = Date.now();
8902
+ if (t2 - t1_1 < t_1 + 100) {
8903
+ hasApp_1 = false;
8904
+ }
8905
+ }, t_1);
8906
+ } else if (isIos) {
8907
+ var url = "".concat(evolution_universal_url).concat(evolution_universal_url.includes('?') ? '&' : '?', "action=").concat(action, "&shareMarkInfo=").concat(shareMarkInfo);
8908
+ pageInit(evolution_scene_url ? "".concat(url, "&sceneUrl=").concat(encodeURIComponent(evolution_scene_url)) : "".concat(url), false, {});
8920
8909
  }
8921
8910
  };
8922
8911
  return [2 /*return*/];