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) ...[
TextFormField(
controller: _emailController,
keyboardType: TextInputType.emailAddress,
decoration: InputDecoration(
labelText: AppLocalizations.of(context).emailLabel,
hintText: AppLocalizations.of(context).emailHint,
prefixIcon: const Icon(Icons.email_outlined),
keyboardType: TextInputType.text,
decoration: const InputDecoration(
labelText: '邮箱 / 手机号',
hintText: '请输入邮箱或手机号',
prefixIcon: Icon(Icons.person_outline),
),
validator: (v) {
if (v == null || v.isEmpty) return '请输入邮箱地址';
if (!v.contains('@')) return '请输入有效的邮箱地址';
if (v == null || v.isEmpty) return '请输入邮箱或手机号';
return null;
},
),