From f3d6ca50f18c0d90417abf3c27502a2ecf68d0cc Mon Sep 17 00:00:00 2001 From: GaoNeng-wWw <gaonenggg@outlook.com> Date: Sat, 27 Jul 2024 20:27:53 +0800 Subject: [PATCH] feat: delete account format check --- app/(root)/authenticate/login/page.tsx | 4 ++-- app/(root)/authenticate/page.tsx | 31 +------------------------- 2 files changed, 3 insertions(+), 32 deletions(-) diff --git a/app/(root)/authenticate/login/page.tsx b/app/(root)/authenticate/login/page.tsx index 509cdfa..0db7b24 100644 --- a/app/(root)/authenticate/login/page.tsx +++ b/app/(root)/authenticate/login/page.tsx @@ -41,8 +41,8 @@ export default function LoginPage(){ <div className='space-y-5'> <div className='space-y-5'> <Input - label={'请输入手机号'} - placeholder={'请输入手机号'} + label={'账号'} + placeholder={'请输入手机号, 用户名或邮箱'} isClearable value={account} onValueChange={setAccount} diff --git a/app/(root)/authenticate/page.tsx b/app/(root)/authenticate/page.tsx index 95c1c7d..0b7f1cb 100644 --- a/app/(root)/authenticate/page.tsx +++ b/app/(root)/authenticate/page.tsx @@ -25,16 +25,6 @@ export default function Page(){ useEffect(()=>{ valideData() }, [ account, policy, phone, email, pageType ]); - const checkAccountExistsByEmail = () => { - return IOC.user.checkEmail(account) - .then((exists:boolean) => exists) - .catch(() => false); - } - const checkAccountExistsByPhone = () => { - return IOC.user.checkPhone(account) - .then((exists:boolean) => exists) - .catch(() => false); - } const onChangeAccount = (account: string) => { setAccount(account); setPageType("wait-check"); @@ -42,26 +32,7 @@ export default function Page(){ const accountCheck = () => { setLoading(true); - if (email){ - checkAccountExistsByEmail() - .then((exists) => { - setShowErr(!exists) - }) - .finally(() => setLoading(false)); - } - if (phone){ - checkAccountExistsByPhone() - .then((exists) => { - if (!exists){ - setPageType('register') - return; - } - setPageType('login') - }) - .finally(()=>{ - setLoading(false); - }) - } + setPageType('login') } const onEnter = (e:KeyboardEvent) => { if (!disabled && e.code.toLowerCase().includes('enter')){