@pisell/private-materials 6.3.123 → 6.3.125
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +4 -4
- package/build/lowcode/render/default/view.js +4 -4
- package/build/lowcode/view.js +4 -4
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/forms/model.d.ts +10 -1
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/model.d.ts +10 -1
- package/es/components/booking/model.d.ts +9 -1
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/eftposPay/amount.js +15 -1
- package/es/components/eftposPay/app.js +2 -1
- package/es/components/eftposPay/component/fail/failCustom.js +12 -4
- package/es/components/eftposPay/component/fail/index.js +14 -6
- package/es/components/eftposPay/component/fail/network.js +3 -0
- package/es/components/eftposPay/component/fail/unknow.js +8 -0
- package/es/components/eftposPay/component/manual/index.js +13 -1
- package/es/components/eftposPay/component/signature/index.js +3 -0
- package/es/components/eftposPay/device.js +33 -22
- package/es/components/eftposPay/index.js +48 -11
- package/es/components/eftposPay/linkly/hooks/normal.js +21 -68
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +20 -81
- package/es/components/eftposPay/linkly/index.js +10 -23
- package/es/components/eftposPay/pay.js +14 -7
- package/es/components/eftposPay/payo/config.js +38 -5
- package/es/components/eftposPay/payo/hooks.js +3 -12
- package/es/components/eftposPay/payo/payment.js +69 -136
- package/es/components/eftposPay/tip.js +5 -0
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eftposPay/tyro/index.js +44 -11
- package/es/components/eftposPay/utils/payLog.d.ts +81 -0
- package/es/components/eftposPay/utils/payLog.js +430 -0
- package/es/components/eftposPay/windcave/receiptAction.js +5 -0
- package/es/components/eftposPay/windcave/windcave.js +28 -29
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +0 -5
- package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +142 -165
- package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +0 -6
- package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +3 -3
- package/es/components/pay/toC/WalletPassBlock/index.js +1 -3
- package/es/components/pay/toC/index.js +31 -65
- package/es/components/pay/toC/model.d.ts +9 -2
- package/es/components/pay/toC/serve.d.ts +0 -18
- package/es/components/pay/toC/serve.js +15 -42
- package/es/components/pay/toC/utils.d.ts +2 -2
- package/es/components/pay/toC/utils.js +0 -4
- package/es/components/schedules/model.d.ts +9 -1
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/hooks/usePaymentLogger.d.ts +0 -1
- package/es/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
- package/es/pro/Login2.0/components/phoneValidation.js +65 -58
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/forms/model.d.ts +10 -1
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/model.d.ts +10 -1
- package/lib/components/booking/model.d.ts +9 -1
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/eftposPay/amount.js +13 -1
- package/lib/components/eftposPay/app.js +2 -1
- package/lib/components/eftposPay/component/fail/failCustom.js +10 -2
- package/lib/components/eftposPay/component/fail/index.js +10 -2
- package/lib/components/eftposPay/component/fail/network.js +3 -0
- package/lib/components/eftposPay/component/fail/unknow.js +8 -0
- package/lib/components/eftposPay/component/manual/index.js +10 -0
- package/lib/components/eftposPay/component/signature/index.js +3 -0
- package/lib/components/eftposPay/device.js +11 -10
- package/lib/components/eftposPay/index.js +36 -11
- package/lib/components/eftposPay/linkly/hooks/normal.js +22 -43
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +13 -65
- package/lib/components/eftposPay/linkly/index.js +7 -10
- package/lib/components/eftposPay/pay.js +9 -1
- package/lib/components/eftposPay/payo/config.js +15 -8
- package/lib/components/eftposPay/payo/hooks.js +12 -10
- package/lib/components/eftposPay/payo/payment.js +31 -65
- package/lib/components/eftposPay/tip.js +5 -0
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eftposPay/tyro/index.js +21 -17
- package/lib/components/eftposPay/utils/payLog.d.ts +81 -0
- package/lib/components/eftposPay/utils/payLog.js +320 -0
- package/lib/components/eftposPay/windcave/receiptAction.js +5 -0
- package/lib/components/eftposPay/windcave/windcave.js +18 -20
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +0 -5
- package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +100 -90
- package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +0 -6
- package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +2 -2
- package/lib/components/pay/toC/WalletPassBlock/index.js +1 -3
- package/lib/components/pay/toC/index.js +19 -52
- package/lib/components/pay/toC/model.d.ts +9 -2
- package/lib/components/pay/toC/serve.d.ts +0 -18
- package/lib/components/pay/toC/serve.js +0 -6
- package/lib/components/pay/toC/utils.d.ts +2 -2
- package/lib/components/pay/toC/utils.js +2 -6
- package/lib/components/schedules/model.d.ts +9 -1
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/hooks/usePaymentLogger.d.ts +0 -1
- package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
- package/lib/pro/Login2.0/components/phoneValidation.js +4 -2
- package/package.json +2 -2
|
@@ -26,14 +26,25 @@ import { getInitState } from "./manufacturer";
|
|
|
26
26
|
import { Provider } from "./store";
|
|
27
27
|
import "./index.less";
|
|
28
28
|
import { getLocale } from "../../utils/locales";
|
|
29
|
+
import payLog, { usePayLog } from "./utils/payLog";
|
|
29
30
|
locales.init(localeTexts, getLocale());
|
|
30
31
|
export default (function (props) {
|
|
31
|
-
var _context$appHelper, _store$getState, _props$
|
|
32
|
+
var _props$params, _context$appHelper, _props$params3, _store$getState, _props$params4, _props$params5;
|
|
32
33
|
var _useState = useState(props.type === EftposEnum.Tyro ? OrderEumn.Null : props.source === RestoreEumn.Restore ? OrderEumn.Restore : OrderEumn.Normal),
|
|
33
34
|
_useState2 = _slicedToArray(_useState, 2),
|
|
34
35
|
check = _useState2[0],
|
|
35
36
|
setCheckStatus = _useState2[1];
|
|
36
37
|
var context = useEngineContext();
|
|
38
|
+
usePayLog({
|
|
39
|
+
paymentType: props.type,
|
|
40
|
+
mode: props.mode || ModeEnum.Pay,
|
|
41
|
+
orderId: (_props$params = props.params) === null || _props$params === void 0 ? void 0 : _props$params.order_id,
|
|
42
|
+
extra: {
|
|
43
|
+
initialParams: (props === null || props === void 0 ? void 0 : props.params) || null,
|
|
44
|
+
initialSource: (props === null || props === void 0 ? void 0 : props.source) || '',
|
|
45
|
+
initialDevice: (props === null || props === void 0 ? void 0 : props.device) || null
|
|
46
|
+
}
|
|
47
|
+
});
|
|
37
48
|
var _useState3 = useState(0),
|
|
38
49
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
39
50
|
cardSurcharge = _useState4[0],
|
|
@@ -69,20 +80,30 @@ export default (function (props) {
|
|
|
69
80
|
store = _ref.store;
|
|
70
81
|
|
|
71
82
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
83
|
+
* 优先从 props.params.platform 中获取渠道信息,其次读取 storage 中的 channel 字段
|
|
84
|
+
* terminal: terminal 内嵌
|
|
85
|
+
* android_kiosk / kiosk: kiosk 内嵌
|
|
86
|
+
* 默认: web
|
|
74
87
|
*/
|
|
75
88
|
var channel = useMemo(function () {
|
|
76
|
-
var _storage$get;
|
|
77
|
-
|
|
78
|
-
|
|
89
|
+
var _props$params2, _storage$get;
|
|
90
|
+
if ((props === null || props === void 0 || (_props$params2 = props.params) === null || _props$params2 === void 0 ? void 0 : _props$params2.platform) === 'kiosk') {
|
|
91
|
+
return 'kiosk';
|
|
92
|
+
}
|
|
93
|
+
var rawChannel = (storage === null || storage === void 0 || (_storage$get = storage.get) === null || _storage$get === void 0 ? void 0 : _storage$get.call(storage, 'channel')) || '';
|
|
94
|
+
if (rawChannel === 'terminal') {
|
|
79
95
|
return 'terminal';
|
|
80
96
|
}
|
|
81
|
-
if (
|
|
97
|
+
if (rawChannel === 'android_kiosk') {
|
|
82
98
|
return 'kiosk';
|
|
83
99
|
}
|
|
84
100
|
return '';
|
|
85
|
-
}, []);
|
|
101
|
+
}, [props === null || props === void 0 || (_props$params3 = props.params) === null || _props$params3 === void 0 ? void 0 : _props$params3.platform, storage]);
|
|
102
|
+
useEffect(function () {
|
|
103
|
+
payLog.setContext({
|
|
104
|
+
channel: channel || 'web'
|
|
105
|
+
});
|
|
106
|
+
}, [channel]);
|
|
86
107
|
var isMobile = useMemo(function () {
|
|
87
108
|
return Boolean(channel);
|
|
88
109
|
}, [channel]);
|
|
@@ -132,6 +153,11 @@ export default (function (props) {
|
|
|
132
153
|
stateRef.current = state;
|
|
133
154
|
}, [state]);
|
|
134
155
|
var onChangeStatus = useCallback(function (status, params, other) {
|
|
156
|
+
payLog.log('支付状态回调', {
|
|
157
|
+
status: status,
|
|
158
|
+
params: params,
|
|
159
|
+
other: other
|
|
160
|
+
});
|
|
135
161
|
props.onChangeStatus(status, params, other);
|
|
136
162
|
}, []);
|
|
137
163
|
var action = useMemo(function () {
|
|
@@ -167,11 +193,10 @@ export default (function (props) {
|
|
|
167
193
|
}, [mode, state]);
|
|
168
194
|
useEffect(function () {
|
|
169
195
|
document.body.id = 'body';
|
|
170
|
-
console.log('初始化 ........112218017777');
|
|
171
196
|
}, []);
|
|
172
197
|
|
|
173
198
|
// console.log('action = ', action);
|
|
174
|
-
console.log('props?.params?.device_number = ', props === null || props === void 0 || (_props$
|
|
199
|
+
console.log('props?.params?.device_number = ', props === null || props === void 0 || (_props$params4 = props.params) === null || _props$params4 === void 0 ? void 0 : _props$params4.device_number);
|
|
175
200
|
|
|
176
201
|
/**
|
|
177
202
|
* @title: api 接口 数据
|
|
@@ -188,12 +213,14 @@ export default (function (props) {
|
|
|
188
213
|
if (props.source === RestoreEumn.Restore || props.type === EftposEnum.Tyro) {
|
|
189
214
|
return;
|
|
190
215
|
}
|
|
216
|
+
payLog.log('交易检查:开始检查交易');
|
|
191
217
|
api.getTransaction({
|
|
192
218
|
order_id: stateRef.current.order_id,
|
|
193
219
|
card_reader_type: stateRef.current.eftpos,
|
|
194
220
|
receive_status: 'unprocessed'
|
|
195
221
|
}).then(function (res) {
|
|
196
222
|
if (!Array.isArray(res.data) || res.data.length === 0) {
|
|
223
|
+
payLog.log('交易检查:无未处理交易');
|
|
197
224
|
setCheckStatus(OrderEumn.Null);
|
|
198
225
|
return;
|
|
199
226
|
}
|
|
@@ -210,6 +237,9 @@ export default (function (props) {
|
|
|
210
237
|
return item.number;
|
|
211
238
|
});
|
|
212
239
|
if (latest.status === OrderEumn.Failed) {
|
|
240
|
+
payLog.log('交易检查:最新交易已失败', {
|
|
241
|
+
number: latest.number
|
|
242
|
+
});
|
|
213
243
|
setCheckStatus(latest.status);
|
|
214
244
|
onChangeStatus('mark_tx_processed', [].concat(_toConsumableArray(numberList), [latest.number]));
|
|
215
245
|
return;
|
|
@@ -231,8 +261,15 @@ export default (function (props) {
|
|
|
231
261
|
try {
|
|
232
262
|
var data = JSON.parse(decodeURIComponent(atob(decodeURIComponent(pay_param_base64))));
|
|
233
263
|
setHistory(data);
|
|
264
|
+
payLog.log('交易检查:发现待处理交易', {
|
|
265
|
+
status: latest.status,
|
|
266
|
+
number: latest.number
|
|
267
|
+
});
|
|
234
268
|
setCheckStatus(latest.status);
|
|
235
269
|
} catch (e) {
|
|
270
|
+
payLog.log('交易检查:解析交易数据失败', {
|
|
271
|
+
error: e
|
|
272
|
+
});
|
|
236
273
|
setCheckStatus(OrderEumn.Failed);
|
|
237
274
|
return;
|
|
238
275
|
}
|
|
@@ -267,7 +304,7 @@ export default (function (props) {
|
|
|
267
304
|
source: props.source,
|
|
268
305
|
tyroUrl: props.tyroUrl,
|
|
269
306
|
tyroVersion: props.tyroVersion,
|
|
270
|
-
device_number: props === null || props === void 0 || (_props$
|
|
307
|
+
device_number: props === null || props === void 0 || (_props$params5 = props.params) === null || _props$params5 === void 0 ? void 0 : _props$params5.device_number,
|
|
271
308
|
isMobile: isMobile,
|
|
272
309
|
formatAmount: formatAmount
|
|
273
310
|
}));
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { useRequest } from 'ahooks';
|
|
2
2
|
import { useEffect, useRef } from 'react';
|
|
3
|
-
import { locales
|
|
3
|
+
import { locales } from '@pisell/utils';
|
|
4
4
|
import { linklyPayCancelApi, linklyPayApi, linklyRefundCancelApi, linklyRefundApi, linklyPaySignatureApi, linklyRefundSignatureApi } from "../service";
|
|
5
5
|
import { useFail, useStoreRef } from "../../hooks";
|
|
6
6
|
import { ModeEnum, PayStatus, StatusEnum } from "../../const";
|
|
7
7
|
import { useDispatch, updateState, updateCustom, updateStatus } from "../../store";
|
|
8
8
|
import { LinklyActionStatus } from "../const";
|
|
9
|
+
import payLog from "../../utils/payLog";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* 支付或退款
|
|
@@ -61,12 +62,8 @@ export var useLinklyPayOrRefund = function useLinklyPayOrRefund(handleCheck) {
|
|
|
61
62
|
if (!handleCheck()) {
|
|
62
63
|
return;
|
|
63
64
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
content: [{
|
|
67
|
-
key: 'response',
|
|
68
|
-
value: JSON.stringify(res)
|
|
69
|
-
}]
|
|
65
|
+
payLog.log("Linkly\uFF1A".concat(isPay ? '支付' : '退款', "\u63A5\u53E3\u6210\u529F"), {
|
|
66
|
+
res: res
|
|
70
67
|
});
|
|
71
68
|
|
|
72
69
|
// status 交易状态 0:未知,继续查询 1:成功 -1:失败 -2:交易错误
|
|
@@ -120,12 +117,8 @@ export var useLinklyPayOrRefund = function useLinklyPayOrRefund(handleCheck) {
|
|
|
120
117
|
if (!handleCheck()) {
|
|
121
118
|
return;
|
|
122
119
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
content: [{
|
|
126
|
-
key: 'error',
|
|
127
|
-
value: JSON.stringify(error)
|
|
128
|
-
}]
|
|
120
|
+
payLog.log("Linkly\uFF1A".concat(isPay ? '支付' : '退款', "\u63A5\u53E3\u5931\u8D25"), {
|
|
121
|
+
error: JSON.stringify(error || {})
|
|
129
122
|
});
|
|
130
123
|
(_failRef$current2 = failRef.current) === null || _failRef$current2 === void 0 || _failRef$current2.call(failRef, error, false);
|
|
131
124
|
};
|
|
@@ -141,12 +134,11 @@ export var useLinklyPayOrRefund = function useLinklyPayOrRefund(handleCheck) {
|
|
|
141
134
|
// 交易金额, 包含选择的订单金额+手续费,订单金额+手续费=交易金额
|
|
142
135
|
amount: isPay ? (_payRef$current = payRef.current) === null || _payRef$current === void 0 ? void 0 : _payRef$current.total : amountRef.current
|
|
143
136
|
};
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}]
|
|
137
|
+
payLog.setContext({
|
|
138
|
+
transactionNumber: String(orderIdRef.current)
|
|
139
|
+
});
|
|
140
|
+
payLog.log("Linkly\uFF1A\u53D1\u8D77".concat(isPay ? '支付' : '退款'), {
|
|
141
|
+
param: param
|
|
150
142
|
});
|
|
151
143
|
_pay.run(param);
|
|
152
144
|
};
|
|
@@ -179,23 +171,9 @@ export var useLinklyCancel = function useLinklyCancel(handleCheck) {
|
|
|
179
171
|
if (!handleCheck()) {
|
|
180
172
|
return;
|
|
181
173
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
content: [{
|
|
186
|
-
key: 'response',
|
|
187
|
-
value: JSON.stringify(res)
|
|
188
|
-
}]
|
|
189
|
-
});
|
|
190
|
-
} else {
|
|
191
|
-
sendWarningLog({
|
|
192
|
-
title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u53D6\u6D88\u5931\u8D25"),
|
|
193
|
-
content: [{
|
|
194
|
-
key: 'error',
|
|
195
|
-
value: JSON.stringify(res)
|
|
196
|
-
}]
|
|
197
|
-
});
|
|
198
|
-
}
|
|
174
|
+
payLog.log("Linkly\uFF1A\u53D6\u6D88".concat(type === 'success' ? '成功' : '失败'), {
|
|
175
|
+
res: res
|
|
176
|
+
});
|
|
199
177
|
(_resultQueryRef$curre2 = resultQueryRef.current) === null || _resultQueryRef$curre2 === void 0 || _resultQueryRef$curre2.call(resultQueryRef);
|
|
200
178
|
};
|
|
201
179
|
var _cancel = useRequest(isPay ? linklyPayCancelApi : linklyRefundCancelApi, {
|
|
@@ -210,22 +188,15 @@ export var useLinklyCancel = function useLinklyCancel(handleCheck) {
|
|
|
210
188
|
var linklyCancel = function linklyCancel(resultQuery) {
|
|
211
189
|
var _deviceRef$current2;
|
|
212
190
|
resultQueryRef.current = resultQuery;
|
|
213
|
-
// 需要将按钮状态锁定,防止重复点击
|
|
214
191
|
dispatch(updateCustom({
|
|
215
192
|
buttonDisabled: true
|
|
216
193
|
}));
|
|
217
194
|
var param = {
|
|
218
|
-
// 设备id
|
|
219
195
|
pinpad_id: deviceRef === null || deviceRef === void 0 || (_deviceRef$current2 = deviceRef.current) === null || _deviceRef$current2 === void 0 || (_deviceRef$current2 = _deviceRef$current2.metadata) === null || _deviceRef$current2 === void 0 ? void 0 : _deviceRef$current2.linkly_pinpad_id,
|
|
220
|
-
// 交易流水号
|
|
221
196
|
session_id: numRef.current
|
|
222
197
|
};
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
content: [{
|
|
226
|
-
key: 'params',
|
|
227
|
-
value: JSON.stringify(param)
|
|
228
|
-
}]
|
|
198
|
+
payLog.log('Linkly:发起取消', {
|
|
199
|
+
param: param
|
|
229
200
|
});
|
|
230
201
|
_cancel.run(param);
|
|
231
202
|
dispatch(updateCustom({
|
|
@@ -258,23 +229,9 @@ export var useLinklySignature = function useLinklySignature(handleCheck) {
|
|
|
258
229
|
if (!handleCheck()) {
|
|
259
230
|
return;
|
|
260
231
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
content: [{
|
|
265
|
-
key: 'response',
|
|
266
|
-
value: JSON.stringify(res)
|
|
267
|
-
}]
|
|
268
|
-
});
|
|
269
|
-
} else {
|
|
270
|
-
sendWarningLog({
|
|
271
|
-
title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u7B7E\u540D\u5931\u8D25"),
|
|
272
|
-
content: [{
|
|
273
|
-
key: 'error',
|
|
274
|
-
value: JSON.stringify(res)
|
|
275
|
-
}]
|
|
276
|
-
});
|
|
277
|
-
}
|
|
232
|
+
payLog.log("Linkly\uFF1A\u7B7E\u540D\u63A5\u53E3".concat(type === 'success' ? '成功' : '失败'), {
|
|
233
|
+
res: res
|
|
234
|
+
});
|
|
278
235
|
(_resultQueryRef$curre3 = resultQueryRef.current) === null || _resultQueryRef$curre3 === void 0 || _resultQueryRef$curre3.call(resultQueryRef);
|
|
279
236
|
};
|
|
280
237
|
var _signature = useRequest(isPay ? linklyPaySignatureApi : linklyRefundSignatureApi, {
|
|
@@ -303,12 +260,8 @@ export var useLinklySignature = function useLinklySignature(handleCheck) {
|
|
|
303
260
|
dispatch(updateCustom({
|
|
304
261
|
actionStatus: LinklyActionStatus.SignatureWaiting
|
|
305
262
|
}));
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
content: [{
|
|
309
|
-
key: 'params',
|
|
310
|
-
value: JSON.stringify(param)
|
|
311
|
-
}]
|
|
263
|
+
payLog.log('Linkly:发起签名', {
|
|
264
|
+
param: param
|
|
312
265
|
});
|
|
313
266
|
_signature.run(param);
|
|
314
267
|
};
|
|
@@ -3,12 +3,12 @@ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyri
|
|
|
3
3
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
4
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
5
|
import { useRef } from 'react';
|
|
6
|
-
import {
|
|
7
|
-
import dayjs from 'dayjs';
|
|
6
|
+
import { locales } from '@pisell/utils';
|
|
8
7
|
import { useDispatch, updateCustom, updateStatus, updateState } from "../../store";
|
|
9
8
|
import { useFail, useStoreRef } from "../../hooks";
|
|
10
9
|
import { ModeEnum, PayStatus, StatusEnum } from "../../const";
|
|
11
10
|
import { LinklyActionStatus } from "../const";
|
|
11
|
+
import payLog from "../../utils/payLog";
|
|
12
12
|
|
|
13
13
|
// 全局超时时间
|
|
14
14
|
var GlobalTimeout = 1000 * 60 * 2;
|
|
@@ -21,8 +21,7 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
21
21
|
var _useStoreRef = useStoreRef(),
|
|
22
22
|
numRef = _useStoreRef.numRef,
|
|
23
23
|
modeRef = _useStoreRef.modeRef,
|
|
24
|
-
deviceRef = _useStoreRef.deviceRef
|
|
25
|
-
orderIdRef = _useStoreRef.orderIdRef;
|
|
24
|
+
deviceRef = _useStoreRef.deviceRef;
|
|
26
25
|
var fail = useFail(0);
|
|
27
26
|
var failRef = useRef(fail);
|
|
28
27
|
var isPay = modeRef.current === ModeEnum.Pay || modeRef.current === ModeEnum.FullPay;
|
|
@@ -38,8 +37,6 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
38
37
|
var startTimeRef = useRef(null);
|
|
39
38
|
// 查询是否结束
|
|
40
39
|
var isQueryFinishedRef = useRef(true);
|
|
41
|
-
// 每轮查询的唯一标识
|
|
42
|
-
var queryIdRef = useRef(null);
|
|
43
40
|
// 轮询间隔定时器
|
|
44
41
|
var queryIntervalTimerRef = useRef(null);
|
|
45
42
|
var _resultQuery = /*#__PURE__*/function () {
|
|
@@ -64,8 +61,7 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
64
61
|
// 设置单次请求超时定时器
|
|
65
62
|
requestTimeoutIdRef.current = setTimeout(function () {
|
|
66
63
|
var _controllerRef$curren;
|
|
67
|
-
|
|
68
|
-
_log("RequestTimeout");
|
|
64
|
+
payLog.log('Linkly轮询:单次请求超时');
|
|
69
65
|
(_controllerRef$curren = controllerRef.current) === null || _controllerRef$curren === void 0 || _controllerRef$curren.abort();
|
|
70
66
|
isRequestCanceledRef.current = true;
|
|
71
67
|
}, RequestTimeout);
|
|
@@ -92,14 +88,7 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
92
88
|
var data = (result === null || result === void 0 ? void 0 : result.data) || {};
|
|
93
89
|
// 交易成功,终止查询
|
|
94
90
|
if (data.status == 1) {
|
|
95
|
-
|
|
96
|
-
sendWarningLog({
|
|
97
|
-
title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u4EA4\u6613\u6210\u529F"),
|
|
98
|
-
content: [{
|
|
99
|
-
key: 'response',
|
|
100
|
-
value: JSON.stringify(result)
|
|
101
|
-
}]
|
|
102
|
-
});
|
|
91
|
+
payLog.log('Linkly轮询:交易成功');
|
|
103
92
|
reset();
|
|
104
93
|
handleLinklySuccess(result);
|
|
105
94
|
return;
|
|
@@ -107,8 +96,9 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
107
96
|
|
|
108
97
|
// 交易状态为0,且不需要签名,则继续查询
|
|
109
98
|
if ((data === null || data === void 0 ? void 0 : data.status) == 0 && (data === null || data === void 0 ? void 0 : data.signature_flag) != 1) {
|
|
110
|
-
|
|
111
|
-
|
|
99
|
+
payLog.log('Linkly轮询:继续查询', {
|
|
100
|
+
data: data
|
|
101
|
+
});
|
|
112
102
|
isQueryFinishedRef.current = false;
|
|
113
103
|
queryIntervalTimerRef.current = setTimeout(function () {
|
|
114
104
|
_resultQuery();
|
|
@@ -119,13 +109,8 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
119
109
|
// 交易状态为-1,则交易失败,不可前往支付标记页面
|
|
120
110
|
if (data.status < 0) {
|
|
121
111
|
var _failRef$current;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u4EA4\u6613\u5931\u8D25"),
|
|
125
|
-
content: [{
|
|
126
|
-
key: 'response',
|
|
127
|
-
value: JSON.stringify(result)
|
|
128
|
-
}]
|
|
112
|
+
payLog.log('Linkly轮询:交易失败', {
|
|
113
|
+
data: data
|
|
129
114
|
});
|
|
130
115
|
reset();
|
|
131
116
|
// 交易失败,code码转换为支付失败code码
|
|
@@ -136,13 +121,8 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
136
121
|
|
|
137
122
|
// 需要签名
|
|
138
123
|
if (data.signature_flag == 1) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u4EA4\u6613\u9700\u8981\u7B7E\u540D"),
|
|
142
|
-
content: [{
|
|
143
|
-
key: 'response',
|
|
144
|
-
value: JSON.stringify(result)
|
|
145
|
-
}]
|
|
124
|
+
payLog.log('Linkly轮询:需要签名', {
|
|
125
|
+
data: data
|
|
146
126
|
});
|
|
147
127
|
reset();
|
|
148
128
|
gotoSignature();
|
|
@@ -158,8 +138,7 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
158
138
|
}
|
|
159
139
|
isQueryFinishedRef.current = true;
|
|
160
140
|
if ((error === null || error === void 0 ? void 0 : error.name) === "AbortError" || isRequestCanceledRef.current) {
|
|
161
|
-
|
|
162
|
-
console.log('Error: 请求被取消,将继续查询');
|
|
141
|
+
payLog.log('Linkly轮询:请求被取消,继续查询');
|
|
163
142
|
isQueryFinishedRef.current = false;
|
|
164
143
|
queryIntervalTimerRef.current = setTimeout(function () {
|
|
165
144
|
_resultQuery();
|
|
@@ -169,15 +148,16 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
169
148
|
|
|
170
149
|
// 网关类报错,继续查询
|
|
171
150
|
if (!(error !== null && error !== void 0 && error.code) || "".concat(error.code) === PayStatus.Timeout) {
|
|
172
|
-
|
|
173
|
-
console.log('Error: 网关类报错,将继续查询');
|
|
151
|
+
payLog.log('Linkly轮询:网关报错,继续查询');
|
|
174
152
|
isQueryFinishedRef.current = false;
|
|
175
153
|
queryIntervalTimerRef.current = setTimeout(function () {
|
|
176
154
|
_resultQuery();
|
|
177
155
|
}, QUERY_INTERVAL);
|
|
178
156
|
return;
|
|
179
157
|
}
|
|
180
|
-
|
|
158
|
+
payLog.log('Linkly轮询:查询失败', {
|
|
159
|
+
error: error
|
|
160
|
+
});
|
|
181
161
|
reset();
|
|
182
162
|
(_failRef$current2 = failRef.current) === null || _failRef$current2 === void 0 || _failRef$current2.call(failRef, error, true);
|
|
183
163
|
}).finally(function () {
|
|
@@ -236,8 +216,7 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
236
216
|
* 重置查询状态
|
|
237
217
|
*/
|
|
238
218
|
var reset = function reset() {
|
|
239
|
-
|
|
240
|
-
_log("Reset");
|
|
219
|
+
payLog.log('Linkly轮询:重置查询状态');
|
|
241
220
|
if (globalTimeoutIdRef.current) {
|
|
242
221
|
clearTimeout(globalTimeoutIdRef.current);
|
|
243
222
|
globalTimeoutIdRef.current = null;
|
|
@@ -257,43 +236,6 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
257
236
|
startTimeRef.current = null;
|
|
258
237
|
isRequestCanceledRef.current = false;
|
|
259
238
|
isQueryFinishedRef.current = true;
|
|
260
|
-
queryIdRef.current = null;
|
|
261
|
-
};
|
|
262
|
-
var _log = function _log(type, res) {
|
|
263
|
-
var _deviceRef$current2;
|
|
264
|
-
var params = {
|
|
265
|
-
// 设备id
|
|
266
|
-
pinpad_id: deviceRef === null || deviceRef === void 0 || (_deviceRef$current2 = deviceRef.current) === null || _deviceRef$current2 === void 0 || (_deviceRef$current2 = _deviceRef$current2.metadata) === null || _deviceRef$current2 === void 0 ? void 0 : _deviceRef$current2.linkly_pinpad_id,
|
|
267
|
-
// 交易流水号
|
|
268
|
-
session_id: numRef.current
|
|
269
|
-
};
|
|
270
|
-
var content = [{
|
|
271
|
-
key: 'description',
|
|
272
|
-
value: JSON.stringify({
|
|
273
|
-
queryId: queryIdRef.current,
|
|
274
|
-
orderId: orderIdRef.current,
|
|
275
|
-
type: type,
|
|
276
|
-
date: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
277
|
-
})
|
|
278
|
-
}, {
|
|
279
|
-
key: 'params',
|
|
280
|
-
value: JSON.stringify(params)
|
|
281
|
-
}];
|
|
282
|
-
if (type === "Error") {
|
|
283
|
-
content.push({
|
|
284
|
-
key: 'error',
|
|
285
|
-
value: JSON.stringify(res)
|
|
286
|
-
});
|
|
287
|
-
} else {
|
|
288
|
-
content.push({
|
|
289
|
-
key: 'response',
|
|
290
|
-
value: JSON.stringify(res)
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
sendWarningLog({
|
|
294
|
-
title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u4EA4\u6613\u7ED3\u679C\u8F6E\u8BE2"),
|
|
295
|
-
content: content
|
|
296
|
-
});
|
|
297
239
|
};
|
|
298
240
|
var run = function run() {
|
|
299
241
|
// 重置状态
|
|
@@ -302,8 +244,7 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
302
244
|
// 设置全局超时定时器
|
|
303
245
|
globalTimeoutIdRef.current = setTimeout(function () {
|
|
304
246
|
var _failRef$current3;
|
|
305
|
-
|
|
306
|
-
_log("GlobalTimeout");
|
|
247
|
+
payLog.log('Linkly轮询:全局超时');
|
|
307
248
|
setTimeout(reset, 0);
|
|
308
249
|
// 交易超时,需要手动标记交易状态
|
|
309
250
|
(_failRef$current3 = failRef.current) === null || _failRef$current3 === void 0 || _failRef$current3.call(failRef, {
|
|
@@ -312,9 +253,7 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
312
253
|
}, GlobalTimeout);
|
|
313
254
|
startTimeRef.current = Date.now();
|
|
314
255
|
isQueryFinishedRef.current = false;
|
|
315
|
-
|
|
316
|
-
console.log('开始查询linkly结果---->>>>>>>');
|
|
317
|
-
_log("Start");
|
|
256
|
+
payLog.log('Linkly轮询:开始查询');
|
|
318
257
|
return _resultQuery();
|
|
319
258
|
};
|
|
320
259
|
return {
|
|
@@ -9,7 +9,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
9
9
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
10
|
import React, { useEffect, useRef } from 'react';
|
|
11
11
|
import { Button } from 'antd';
|
|
12
|
-
import { locales
|
|
12
|
+
import { locales } from '@pisell/utils';
|
|
13
13
|
import { useContextData, useDispatch, updateCustom, updateState, updateNextStep } from "../store";
|
|
14
14
|
import { useFail, useStoreRef } from "../hooks";
|
|
15
15
|
import useEngineContext from "../../../hooks/useEngineContext";
|
|
@@ -19,6 +19,7 @@ import { StatusEnum } from "../const";
|
|
|
19
19
|
import { useLinklyCancel, useLinklyPayOrRefund, useTimeResultQuery, useLinklySignature } from "./hooks";
|
|
20
20
|
import { LinklyActionStatus } from "./const";
|
|
21
21
|
import { getPayParams } from "../helper";
|
|
22
|
+
import payLog from "../utils/payLog";
|
|
22
23
|
var Linkly = function Linkly(_ref) {
|
|
23
24
|
var api = _ref.api,
|
|
24
25
|
onChange = _ref.onChange;
|
|
@@ -52,6 +53,7 @@ var Linkly = function Linkly(_ref) {
|
|
|
52
53
|
return !(unloadRef.current || !netRef.current);
|
|
53
54
|
};
|
|
54
55
|
var handleLinklySuccess = function handleLinklySuccess(res) {
|
|
56
|
+
payLog.log('Linkly:最终支付成功');
|
|
55
57
|
var resData = (res === null || res === void 0 ? void 0 : res.data) || {};
|
|
56
58
|
var receipt = Array.isArray(resData === null || resData === void 0 ? void 0 : resData.receipt) ? resData.receipt : [resData.receipt];
|
|
57
59
|
receipt = receipt.filter(function (item) {
|
|
@@ -139,14 +141,8 @@ var Linkly = function Linkly(_ref) {
|
|
|
139
141
|
if (activeStatus !== 'unActive') {
|
|
140
142
|
payOrRefund(resultQuery, handleLinklySuccess);
|
|
141
143
|
} else {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
content: [{
|
|
145
|
-
key: 'response',
|
|
146
|
-
value: JSON.stringify({
|
|
147
|
-
activeStatus: activeStatus
|
|
148
|
-
})
|
|
149
|
-
}]
|
|
144
|
+
payLog.log('Linkly:页面非活跃状态,阻断支付', {
|
|
145
|
+
activeStatus: activeStatus
|
|
150
146
|
});
|
|
151
147
|
}
|
|
152
148
|
_context.next = 11;
|
|
@@ -154,12 +150,8 @@ var Linkly = function Linkly(_ref) {
|
|
|
154
150
|
case 7:
|
|
155
151
|
_context.prev = 7;
|
|
156
152
|
_context.t0 = _context["catch"](0);
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
content: [{
|
|
160
|
-
key: 'error',
|
|
161
|
-
value: JSON.stringify(_context.t0)
|
|
162
|
-
}]
|
|
153
|
+
payLog.log('Linkly:获取页面活跃状态失败', {
|
|
154
|
+
error: _context.t0
|
|
163
155
|
});
|
|
164
156
|
// 如果获取活跃状态失败,则进行支付,防止流程卡死
|
|
165
157
|
payOrRefund(resultQuery, handleLinklySuccess);
|
|
@@ -193,22 +185,17 @@ var Linkly = function Linkly(_ref) {
|
|
|
193
185
|
* 取消支付
|
|
194
186
|
*/
|
|
195
187
|
var onCancel = function onCancel() {
|
|
188
|
+
payLog.log('Linkly:点击取消支付');
|
|
196
189
|
stopResultQuery();
|
|
197
190
|
linklyCancel(resultQuery);
|
|
198
191
|
};
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* 拒绝签名
|
|
202
|
-
*/
|
|
203
192
|
var onDecline = function onDecline() {
|
|
193
|
+
payLog.log('Linkly:签名-点击拒绝');
|
|
204
194
|
stopResultQuery();
|
|
205
195
|
linklySignature(2, resultQuery);
|
|
206
196
|
};
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* 接受签名
|
|
210
|
-
*/
|
|
211
197
|
var onAccept = function onAccept() {
|
|
198
|
+
payLog.log('Linkly:签名-点击接受');
|
|
212
199
|
stopResultQuery();
|
|
213
200
|
linklySignature(3, resultQuery);
|
|
214
201
|
};
|
|
@@ -13,6 +13,7 @@ import { StatusEnum, PayRouteEnum, ClientEnum } from "./const";
|
|
|
13
13
|
import { Payo, Windcave, Tyro, Linkly } from "./manufacturer";
|
|
14
14
|
import { useContextData, useDispatch, updateStatus, backUpProduction, updateComponent, backUpFree, updateState } from "./store";
|
|
15
15
|
import "./index.less";
|
|
16
|
+
import payLog from "./utils/payLog";
|
|
16
17
|
|
|
17
18
|
// 定制组件 用于当前页面无法扩展场景
|
|
18
19
|
var Mapping = {
|
|
@@ -45,13 +46,15 @@ var Pay = function Pay(_ref) {
|
|
|
45
46
|
client = _ref.client;
|
|
46
47
|
var data = useContextData();
|
|
47
48
|
var dataRef = useRef(data);
|
|
48
|
-
// console.log("pay = ",'pay')
|
|
49
49
|
var dispatch = useDispatch();
|
|
50
50
|
var ref = useRef(false);
|
|
51
51
|
var statusRef = useRef(data.status);
|
|
52
52
|
var comonentRef = useRef(data.component);
|
|
53
53
|
var backupRef = useRef(data.backup);
|
|
54
|
-
var clearRef = useRef(
|
|
54
|
+
var clearRef = useRef(null);
|
|
55
|
+
useEffect(function () {
|
|
56
|
+
payLog.log('支付组件初始化');
|
|
57
|
+
}, []);
|
|
55
58
|
useEffect(function () {
|
|
56
59
|
comonentRef.current = data.component;
|
|
57
60
|
}, [data.component]);
|
|
@@ -92,10 +95,11 @@ var Pay = function Pay(_ref) {
|
|
|
92
95
|
net: net
|
|
93
96
|
}));
|
|
94
97
|
if (!ref.current) {
|
|
95
|
-
// 初始化
|
|
96
98
|
ref.current = true;
|
|
97
|
-
// 断网&崩溃 恢复处理
|
|
98
99
|
if (backupRef.current && net) {
|
|
100
|
+
payLog.log('网络恢复:从备份恢复', {
|
|
101
|
+
hasBackup: true
|
|
102
|
+
});
|
|
99
103
|
var _data = Object.assign({}, (_objectDestructuringEmpty(backupRef.current), backupRef.current));
|
|
100
104
|
dispatch(backUpFree({
|
|
101
105
|
key: Date.now()
|
|
@@ -115,8 +119,10 @@ var Pay = function Pay(_ref) {
|
|
|
115
119
|
return;
|
|
116
120
|
}
|
|
117
121
|
if (net) {
|
|
122
|
+
payLog.log('网络恢复', {
|
|
123
|
+
hasBackup: !!backupRef.current
|
|
124
|
+
});
|
|
118
125
|
var _data2 = Object.assign({}, (_objectDestructuringEmpty(backupRef.current), backupRef.current));
|
|
119
|
-
// 网络恢复 释放备份
|
|
120
126
|
dispatch(backUpFree({
|
|
121
127
|
key: Date.now()
|
|
122
128
|
}));
|
|
@@ -132,10 +138,10 @@ var Pay = function Pay(_ref) {
|
|
|
132
138
|
}
|
|
133
139
|
return;
|
|
134
140
|
}
|
|
135
|
-
|
|
141
|
+
payLog.log('网络断开,备份数据');
|
|
136
142
|
dispatch(updateState({
|
|
137
143
|
form: 'Network'
|
|
138
|
-
}));
|
|
144
|
+
}));
|
|
139
145
|
dispatch(backUpProduction({}));
|
|
140
146
|
dispatch(updateState({
|
|
141
147
|
net: net,
|
|
@@ -147,6 +153,7 @@ var Pay = function Pay(_ref) {
|
|
|
147
153
|
return function () {
|
|
148
154
|
if (clearRef.current) {
|
|
149
155
|
clearTimeout(clearRef.current);
|
|
156
|
+
clearRef.current = null;
|
|
150
157
|
}
|
|
151
158
|
};
|
|
152
159
|
}, []);
|