去除 paytm biz 的密码
This commit is contained in:
@@ -130,7 +130,6 @@ function PaytmBusinessForm({ onRequestOTP, onVerifyOTP, onSuccess, onError, isDe
|
||||
}) {
|
||||
const [step, setStep] = useState<'credentials' | 'otp' | 'processing'>('credentials');
|
||||
const [mobile, setMobile] = useState('');
|
||||
const [password, setPassword] = useState('');
|
||||
const [otp, setOtp] = useState('');
|
||||
const [sessionId, setSessionId] = useState('');
|
||||
const [loading, setLoading] = useState(false);
|
||||
@@ -140,10 +139,9 @@ function PaytmBusinessForm({ onRequestOTP, onVerifyOTP, onSuccess, onError, isDe
|
||||
|
||||
const handleRequestOTP = async () => {
|
||||
if (!mobile || mobile.length !== 10) { setErrorMsg('请输入10位手机号'); return; }
|
||||
if (!password) { setErrorMsg('请输入密码'); return; }
|
||||
setLoading(true); setErrorMsg('');
|
||||
try {
|
||||
const res = await onRequestOTP(WalletType.PAYTM_BUSINESS, { mobile, password });
|
||||
const res = await onRequestOTP(WalletType.PAYTM_BUSINESS, { mobile });
|
||||
log('RequestOTP:', res);
|
||||
if (res.success) { setSessionId(res.data?.sessionId || ''); setStep('otp'); }
|
||||
else { const msg = res.message || 'Failed to send OTP'; setErrorMsg(msg); onError(msg); }
|
||||
@@ -188,7 +186,6 @@ function PaytmBusinessForm({ onRequestOTP, onVerifyOTP, onSuccess, onError, isDe
|
||||
{step === 'credentials' && (
|
||||
<>
|
||||
<TextInput style={ptStyles.input} placeholder="手机号" placeholderTextColor="#999" keyboardType="phone-pad" maxLength={10} value={mobile} onChangeText={t => { setMobile(t); setErrorMsg(''); }} editable={!loading} />
|
||||
<TextInput style={ptStyles.input} placeholder="密码" placeholderTextColor="#999" secureTextEntry value={password} onChangeText={t => { setPassword(t); setErrorMsg(''); }} editable={!loading} />
|
||||
<TouchableOpacity style={[ptStyles.button, loading && ptStyles.buttonDisabled]} onPress={handleRequestOTP} disabled={loading}>
|
||||
{loading ? <ActivityIndicator color="#fff" /> : <Text style={ptStyles.buttonText}>获取验证码</Text>}
|
||||
</TouchableOpacity>
|
||||
|
||||
Reference in New Issue
Block a user