fix(app): allow phone number in password login field

Phone-invited users register with phone+password.
Changed identifier field from email-only to email/phone,
removed @ validation so phone numbers pass through.
Backend already auto-detects email vs phone.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-03-09 08:06:29 -07:00
parent 1ccdbc0526
commit 1cf502ef91
1 changed files with 6 additions and 7 deletions

View File

@ -124,15 +124,14 @@ class _LoginPageState extends ConsumerState<LoginPage> {
if (_mode == _LoginMode.password) ...[ if (_mode == _LoginMode.password) ...[
TextFormField( TextFormField(
controller: _emailController, controller: _emailController,
keyboardType: TextInputType.emailAddress, keyboardType: TextInputType.text,
decoration: InputDecoration( decoration: const InputDecoration(
labelText: AppLocalizations.of(context).emailLabel, labelText: '邮箱 / 手机号',
hintText: AppLocalizations.of(context).emailHint, hintText: '请输入邮箱或手机号',
prefixIcon: const Icon(Icons.email_outlined), prefixIcon: Icon(Icons.person_outline),
), ),
validator: (v) { validator: (v) {
if (v == null || v.isEmpty) return '请输入邮箱地址'; if (v == null || v.isEmpty) return '请输入邮箱或手机号';
if (!v.contains('@')) return '请输入有效的邮箱地址';
return null; return null;
}, },
), ),