去除 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 [step, setStep] = useState<'credentials' | 'otp' | 'processing'>('credentials');
|
||||||
const [mobile, setMobile] = useState('');
|
const [mobile, setMobile] = useState('');
|
||||||
const [password, setPassword] = useState('');
|
|
||||||
const [otp, setOtp] = useState('');
|
const [otp, setOtp] = useState('');
|
||||||
const [sessionId, setSessionId] = useState('');
|
const [sessionId, setSessionId] = useState('');
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
@@ -140,10 +139,9 @@ function PaytmBusinessForm({ onRequestOTP, onVerifyOTP, onSuccess, onError, isDe
|
|||||||
|
|
||||||
const handleRequestOTP = async () => {
|
const handleRequestOTP = async () => {
|
||||||
if (!mobile || mobile.length !== 10) { setErrorMsg('请输入10位手机号'); return; }
|
if (!mobile || mobile.length !== 10) { setErrorMsg('请输入10位手机号'); return; }
|
||||||
if (!password) { setErrorMsg('请输入密码'); return; }
|
|
||||||
setLoading(true); setErrorMsg('');
|
setLoading(true); setErrorMsg('');
|
||||||
try {
|
try {
|
||||||
const res = await onRequestOTP(WalletType.PAYTM_BUSINESS, { mobile, password });
|
const res = await onRequestOTP(WalletType.PAYTM_BUSINESS, { mobile });
|
||||||
log('RequestOTP:', res);
|
log('RequestOTP:', res);
|
||||||
if (res.success) { setSessionId(res.data?.sessionId || ''); setStep('otp'); }
|
if (res.success) { setSessionId(res.data?.sessionId || ''); setStep('otp'); }
|
||||||
else { const msg = res.message || 'Failed to send OTP'; setErrorMsg(msg); onError(msg); }
|
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' && (
|
{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" 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}>
|
<TouchableOpacity style={[ptStyles.button, loading && ptStyles.buttonDisabled]} onPress={handleRequestOTP} disabled={loading}>
|
||||||
{loading ? <ActivityIndicator color="#fff" /> : <Text style={ptStyles.buttonText}>获取验证码</Text>}
|
{loading ? <ActivityIndicator color="#fff" /> : <Text style={ptStyles.buttonText}>获取验证码</Text>}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|||||||
@@ -549,7 +549,7 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
|
|||||||
return await Api.instance.requestOTP(
|
return await Api.instance.requestOTP(
|
||||||
wt,
|
wt,
|
||||||
p.mobile,
|
p.mobile,
|
||||||
{ password: p.password },
|
{},
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user