diff --git a/src/passport/login.tsx b/src/passport/login.tsx index fa14a11..1ad94e8 100644 --- a/src/passport/login.tsx +++ b/src/passport/login.tsx @@ -35,29 +35,29 @@ const Login = () => { } // 发送短信验证码 - const handleSendSmsCode = async () => { - if (!phone) { - Taro.showToast({ - title: '请输入手机号', - icon: 'error' - }) - return - } - - // 验证手机号格式 - const phoneReg = /^1[3-9]\d{9}$/ - if (!phoneReg.test(phone)) { - Taro.showToast({ - title: '手机号格式不正确', - icon: 'error' - }) - return - } - - // 显示图形验证码弹窗 - fetchCaptcha() - setShowCaptchaModal(true) - } + // const handleSendSmsCode = async () => { + // if (!phone) { + // Taro.showToast({ + // title: '请输入手机号', + // icon: 'error' + // }) + // return + // } + // + // // 验证手机号格式 + // const phoneReg = /^1[3-9]\d{9}$/ + // if (!phoneReg.test(phone)) { + // Taro.showToast({ + // title: '手机号格式不正确', + // icon: 'error' + // }) + // return + // } + // + // // 显示图形验证码弹窗 + // fetchCaptcha() + // setShowCaptchaModal(true) + // } // 确认发送短信验证码 const confirmSendSmsCode = async () => { @@ -96,21 +96,21 @@ const Login = () => { const handleSmsLogin = async () => { if (!phone) { Taro.showToast({ - title: '请输入手机号', + title: '请输入账号', icon: 'error' }) return } // 验证手机号格式 - const phoneReg = /^1[3-9]\d{9}$/ - if (!phoneReg.test(phone)) { - Taro.showToast({ - title: '手机号格式不正确', - icon: 'error' - }) - return - } + // const phoneReg = /^1[3-9]\d{9}$/ + // if (!phoneReg.test(phone)) { + // Taro.showToast({ + // title: '手机号格式不正确', + // icon: 'error' + // }) + // return + // } if (!smsCode) { Taro.showToast({ @@ -123,7 +123,7 @@ const Login = () => { try { setLoading(true) // 短信登录时传入手机号和短信验证码 - const res = await loginBySms({ phone, code: smsCode }) + const res = await loginBySms({ phone, code:smsCode }) console.log(res,'.......') Taro.showToast({ @@ -232,8 +232,7 @@ const Login = () => { }}> setPhone(val)} style={{ @@ -258,9 +257,8 @@ const Login = () => { borderRadius: '8px' }}> setSmsCode(val)} style={{ @@ -269,18 +267,6 @@ const Login = () => { padding: '10px' }} /> - @@ -317,7 +303,7 @@ const Login = () => { checked={isAgree} onClick={() => setIsAgree(!isAgree)} /> - setIsAgree(!isAgree)}>勾选表示您已阅读并同意 + setIsAgree(!isAgree)}>已阅读并同意 Taro.navigateTo({url: '/passport/agreement'})} style={{color: '#1890ff'}}