chore: prompt user if redemption code not input

This commit is contained in:
JustSong 2023-05-21 10:32:47 +08:00
parent 2eee97e9b6
commit 1cc7c20183

View File

@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
import { Button, Form, Grid, Header, Segment, Statistic } from 'semantic-ui-react';
import { API, showError, showSuccess } from '../../helpers';
import { API, showError, showInfo, showSuccess } from '../../helpers';
const TopUp = () => {
const [redemptionCode, setRedemptionCode] = useState('');
@ -9,6 +9,7 @@ const TopUp = () => {
const topUp = async () => {
if (redemptionCode === '') {
showInfo('请输入充值码!')
return;
}
const res = await API.post('/api/user/topup', {