Commit 35348892 by wzxjohn

fix: for AI review problems

parent 11ef2c32
...@@ -438,6 +438,7 @@ const TopUp = () => { ...@@ -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 = () => { ...@@ -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 = () => { ...@@ -457,6 +458,7 @@ const TopUp = () => {
} catch (err) { } catch (err) {
console.log(err); console.log(err);
} finally { } finally {
setAmountLoading(false);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment