feat: 实现密码重置功能与用户搜索API,优化注册登录流程
- 新增忘记密码页面与重置密码确认流程(前端+后端) - 修复注册验证码页登录跳转路由 - 新增用户搜索API(按邮箱查询) - 简化infra脚本,统一为app.sh - 补充密码重置与用户API测试覆盖 - 更新runtime文档与AGENTS配置
This commit is contained in:
@@ -12,6 +12,7 @@ class RegisterState extends Equatable {
|
||||
final Email email;
|
||||
final Password password;
|
||||
final VerificationCode verificationCode;
|
||||
final String inviteCode;
|
||||
final FormzSubmissionStatus status;
|
||||
final String? errorMessage;
|
||||
final String? pendingEmail;
|
||||
@@ -23,6 +24,7 @@ class RegisterState extends Equatable {
|
||||
this.email = const Email.pure(),
|
||||
this.password = const Password.pure(),
|
||||
this.verificationCode = const VerificationCode.pure(),
|
||||
this.inviteCode = '',
|
||||
this.status = FormzSubmissionStatus.initial,
|
||||
this.errorMessage,
|
||||
this.pendingEmail,
|
||||
@@ -39,6 +41,7 @@ class RegisterState extends Equatable {
|
||||
Email? email,
|
||||
Password? password,
|
||||
VerificationCode? verificationCode,
|
||||
String? inviteCode,
|
||||
FormzSubmissionStatus? status,
|
||||
String? errorMessage,
|
||||
String? pendingEmail,
|
||||
@@ -50,6 +53,7 @@ class RegisterState extends Equatable {
|
||||
email: email ?? this.email,
|
||||
password: password ?? this.password,
|
||||
verificationCode: verificationCode ?? this.verificationCode,
|
||||
inviteCode: inviteCode ?? this.inviteCode,
|
||||
status: status ?? this.status,
|
||||
errorMessage: errorMessage,
|
||||
pendingEmail: pendingEmail ?? this.pendingEmail,
|
||||
@@ -64,6 +68,7 @@ class RegisterState extends Equatable {
|
||||
email,
|
||||
password,
|
||||
verificationCode,
|
||||
inviteCode,
|
||||
status,
|
||||
errorMessage,
|
||||
pendingEmail,
|
||||
@@ -93,6 +98,10 @@ class RegisterCubit extends Cubit<RegisterState> {
|
||||
emit(state.copyWith(verificationCode: VerificationCode.dirty(value)));
|
||||
}
|
||||
|
||||
void inviteCodeChanged(String value) {
|
||||
emit(state.copyWith(inviteCode: value));
|
||||
}
|
||||
|
||||
Future<bool> submitStep1() async {
|
||||
if (!state.isStep1Valid) return false;
|
||||
|
||||
@@ -104,6 +113,7 @@ class RegisterCubit extends Cubit<RegisterState> {
|
||||
username: state.username.value,
|
||||
email: state.email.value,
|
||||
password: state.password.value,
|
||||
inviteCode: state.inviteCode.isNotEmpty ? state.inviteCode : null,
|
||||
),
|
||||
);
|
||||
emit(
|
||||
@@ -202,6 +212,7 @@ class RegisterCubit extends Cubit<RegisterState> {
|
||||
username: state.username.value,
|
||||
email: state.email.value,
|
||||
password: state.password.value,
|
||||
inviteCode: state.inviteCode.isNotEmpty ? state.inviteCode : null,
|
||||
),
|
||||
);
|
||||
emit(
|
||||
|
||||
Reference in New Issue
Block a user