MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / preTopUp

Function preTopUp

web/src/pages/TopUp/index.js:166–185  ·  view source on GitHub ↗
(payment)

Source from the content-addressed store, hash-verified

164 };
165
166 const preTopUp = async (payment) => {
167 if (!enableOnlineTopUp) {
168 showError(t('管理员未开启在线充值!'));
169 return;
170 }
171 setPayWay(payment);
172 setPaymentLoading(true);
173 try {
174 await getAmount();
175 if (topUpCount < minTopUp) {
176 showError(t('充值数量不能小于') + minTopUp);
177 return;
178 }
179 setOpen(true);
180 } catch (error) {
181 showError(t('获取金额失败'));
182 } finally {
183 setPaymentLoading(false);
184 }
185 };
186
187 const onlineTopUp = async () => {
188 if (amount === 0) {

Callers 1

index.jsFile · 0.85

Calls 3

showErrorFunction · 0.90
getAmountFunction · 0.85
tFunction · 0.50

Tested by

no test coverage detected