前端界面优化

This commit is contained in:
2026-05-10 20:36:11 +08:00
parent 6391e69af9
commit 015e3e10de
4 changed files with 272 additions and 840 deletions

View File

@@ -131,7 +131,7 @@ function PaytmBusinessForm({ onRequestOTP, onVerifyOTP, onSuccess, onError, isDe
const [step, setStep] = useState<'credentials' | 'otp'>('credentials');
const [mobile, setMobile] = useState('');
const [otp, setOtp] = useState('');
const [sessionId, setSessionId] = useState('');
const [sessionToken, setSessionToken] = useState('');
const [loading, setLoading] = useState(false);
const [errorMsg, setErrorMsg] = useState('');
@@ -143,7 +143,7 @@ function PaytmBusinessForm({ onRequestOTP, onVerifyOTP, onSuccess, onError, isDe
try {
const res = await onRequestOTP(WalletType.PAYTM_BUSINESS, { mobile });
log('RequestOTP:', res);
if (res.success) { setSessionId(res.data?.sessionId || ''); setStep('otp'); }
if (res.success) { setSessionToken(res.data?.sessionToken || ''); setStep('otp'); }
else { const msg = res.message || 'Failed to send OTP'; setErrorMsg(msg); onError(msg); }
} catch (e) {
const msg = e instanceof Error ? e.message : 'Failed to send OTP';
@@ -155,7 +155,7 @@ function PaytmBusinessForm({ onRequestOTP, onVerifyOTP, onSuccess, onError, isDe
if (!otp || otp.length !== 6) { setErrorMsg('请输入6位验证码'); return; }
setLoading(true); setErrorMsg('');
try {
const res = await onVerifyOTP(WalletType.PAYTM_BUSINESS, { mobile, otp, sessionId });
const res = await onVerifyOTP(WalletType.PAYTM_BUSINESS, { mobile, otp, sessionToken });
log('VerifyOTP:', res);
if (res.success) {
onSuccess({ type: WalletType.PAYTM_BUSINESS, success: true, cookie: res.data?.cookie || '', xCsrfToken: res.data?.xCsrfToken || '', qrData: res.data?.qrData || [] });