Phase 6 — Flutter 前端完整对接后端 SMS 认证系统:
新增组件:
- OtpInput: 6位验证码输入框,支持自动跳转、粘贴、错误状态
- CountdownButton: 短信验证码倒计时按钮(60s),发送失败不启动倒计时
新增服务:
- AuthService: 单例认证服务,封装全部 auth API
· sendSmsCode (REGISTER/LOGIN/RESET_PASSWORD/CHANGE_PHONE)
· register / loginByPassword / loginByPhone
· resetPassword / changePassword / changePhone
· refreshToken / logout
· ValueNotifier<AuthResult?> 状态管理
页面重写 (对接真实 API):
- LoginPage: 双 Tab (密码/验证码登录),错误提示 Banner,账户锁定展示
- RegisterPage: 三步注册流程,CountdownButton 集成,密码强度检查
- ForgotPasswordPage: 四步找回密码,验证码重发,密码一致性校验
i18n 补充 (4语言 × 13 新 key):
- login: noAccount, registerNow, networkError, errorPhoneRequired,
errorPasswordMin, errorCodeInvalid
- register: hasAccount, loginNow, errorPhoneRequired, errorCodeInvalid,
errorPasswordWeak, errorTermsRequired
- forgot: errorPasswordMismatch
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| android | ||
| assets/images | ||
| ios | ||
| lib | ||
| .gitignore | ||
| .metadata | ||
| README.md | ||
| analysis_options.yaml | ||
| pubspec.yaml | ||
README.md
genex_consumer
A new Flutter project.
Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.