Commit 35348892 by wzxjohn

fix: for AI review problems

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