fix: for AI review problems

This commit is contained in:
wzxjohn
2025-07-10 21:03:24 +08:00
parent 8be8813cd8
commit 4740293640

View File

@@ -438,6 +438,7 @@ const TopUp = () => {
if (value === undefined) { if (value === undefined) {
value = stripeTopUpCount value = stripeTopUpCount
} }
setAmountLoading(true);
try { try {
const res = await API.post('/api/user/stripe/amount', { const res = await API.post('/api/user/stripe/amount', {
amount: parseFloat(value), amount: parseFloat(value),
@@ -446,9 +447,9 @@ const TopUp = () => {
const { message, data } = res.data; const { message, data } = res.data;
// showInfo(message); // showInfo(message);
if (message === 'success') { if (message === 'success') {
setStripeAmount(parseFloat(data)) setStripeAmount(parseFloat(data));
} else { } else {
setStripeAmount( 0) setStripeAmount(0);
Toast.error({ content: '错误:' + data, id: 'getAmount' }); Toast.error({ content: '错误:' + data, id: 'getAmount' });
} }
} else { } else {
@@ -457,6 +458,7 @@ const TopUp = () => {
} catch (err) { } catch (err) {
console.log(err); console.log(err);
} finally { } finally {
setAmountLoading(false);
} }
} }