@freelog/tools-lib 0.1.155 → 0.1.157

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.
@@ -1,7 +1,6 @@
1
1
  import moment from 'moment';
2
2
  import { stringify } from 'querystring';
3
3
  import axios from 'axios';
4
- import { lib, SHA1 } from 'crypto-js';
5
4
  import { useState, useRef } from 'react';
6
5
  import i18next from 'i18next';
7
6
  import Cookies from 'js-cookie';
@@ -2625,6 +2624,24 @@ function getRewardRecordInfos(params) {
2625
2624
  data: params
2626
2625
  });
2627
2626
  }
2627
+ function listRewardRecordInfos(params) {
2628
+ if (params === void 0) {
2629
+ params = {};
2630
+ }
2631
+
2632
+ return FUtil.Request({
2633
+ method: 'POST',
2634
+ url: "/v2/activities/facade/listRewardRecordInfos",
2635
+ data: params
2636
+ });
2637
+ }
2638
+ function statisticRewardRecords(params) {
2639
+ return FUtil.Request({
2640
+ method: 'POST',
2641
+ url: "/v2/activities/facade/statisticRewardRecords",
2642
+ data: params
2643
+ });
2644
+ }
2628
2645
 
2629
2646
  var Activity = {
2630
2647
  __proto__: null,
@@ -2646,7 +2663,9 @@ var Activity = {
2646
2663
  lotteryList: lotteryList,
2647
2664
  lotteryShow: lotteryShow,
2648
2665
  listInviteFriendInfos: listInviteFriendInfos,
2649
- getRewardRecordInfos: getRewardRecordInfos
2666
+ getRewardRecordInfos: getRewardRecordInfos,
2667
+ listRewardRecordInfos: listRewardRecordInfos,
2668
+ statisticRewardRecords: statisticRewardRecords
2650
2669
  };
2651
2670
 
2652
2671
  var _excluded$9 = ["recordId"];
@@ -2829,23 +2848,60 @@ var Policy = {
2829
2848
  policyTransferTranslation: policyTransferTranslation
2830
2849
  };
2831
2850
 
2851
+ // import * as CryptoJS from 'crypto-js';
2852
+
2832
2853
  /**
2833
2854
  * 根据 File 获取 SHA1 Hash 字符串
2834
2855
  * @param file
2835
2856
  * @return {Promise<string>}
2836
2857
  */
2837
-
2838
2858
  function getSHA1Hash(file) {
2839
2859
  return new Promise(function (resolve) {
2840
2860
  var reader = new FileReader();
2861
+ reader.readAsArrayBuffer(file);
2862
+ reader.onload = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2863
+ var sha1;
2864
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2865
+ while (1) {
2866
+ switch (_context.prev = _context.next) {
2867
+ case 0:
2868
+ if (reader.result) {
2869
+ _context.next = 3;
2870
+ break;
2871
+ }
2841
2872
 
2842
- reader.onload = function () {
2843
- var wordArray = lib.WordArray.create(reader.result);
2844
- var hash = SHA1(wordArray).toString();
2845
- resolve(hash);
2846
- };
2873
+ resolve('');
2874
+ return _context.abrupt("return", '');
2847
2875
 
2848
- reader.readAsArrayBuffer(file);
2876
+ case 3:
2877
+ if (!(typeof reader.result === 'string')) {
2878
+ _context.next = 6;
2879
+ break;
2880
+ }
2881
+
2882
+ resolve('');
2883
+ return _context.abrupt("return", '');
2884
+
2885
+ case 6:
2886
+ _context.next = 8;
2887
+ return self.crypto.subtle.digest('SHA-1', reader.result).then(function (a) {
2888
+ return Array.from(new Uint8Array(a)).map(function (a) {
2889
+ return a.toString(16).padStart(2, '0');
2890
+ }).join('');
2891
+ });
2892
+
2893
+ case 8:
2894
+ sha1 = _context.sent;
2895
+ resolve(sha1);
2896
+ return _context.abrupt("return", '');
2897
+
2898
+ case 11:
2899
+ case "end":
2900
+ return _context.stop();
2901
+ }
2902
+ }
2903
+ }, _callee);
2904
+ }));
2849
2905
  });
2850
2906
  }
2851
2907
  /**
@@ -2881,9 +2937,9 @@ function getUserIDByCookies() {
2881
2937
 
2882
2938
  return Number(uid.replace('uid=', ''));
2883
2939
  }
2884
- function transformServerAPIContractState(_ref) {
2885
- var status = _ref.status,
2886
- authStatus = _ref.authStatus;
2940
+ function transformServerAPIContractState(_ref2) {
2941
+ var status = _ref2.status,
2942
+ authStatus = _ref2.authStatus;
2887
2943
 
2888
2944
  if (status === 0) {
2889
2945
  if (authStatus === 1 || authStatus === 3) {
@@ -3086,10 +3142,30 @@ function operationCategories(_temp) {
3086
3142
  params: params
3087
3143
  });
3088
3144
  }
3145
+ function recordRank(_ref2) {
3146
+ var params = _extends({}, _ref2);
3147
+
3148
+ return FUtil.Request({
3149
+ method: 'POST',
3150
+ url: "/v2/activities/coin/record/rank",
3151
+ data: params
3152
+ });
3153
+ }
3154
+ function rankInfo(_ref3) {
3155
+ var params = _extends({}, _ref3);
3156
+
3157
+ return FUtil.Request({
3158
+ method: 'POST',
3159
+ url: "/v2/activities/coin/record/rankInfo",
3160
+ data: params
3161
+ });
3162
+ }
3089
3163
 
3090
3164
  var Operation = {
3091
3165
  __proto__: null,
3092
- operationCategories: operationCategories
3166
+ operationCategories: operationCategories,
3167
+ recordRank: recordRank,
3168
+ rankInfo: rankInfo
3093
3169
  };
3094
3170
 
3095
3171
  var FServiceAPI = {