feat(app): 班级码验证前后端联调 — AuthBloc接入API + 错误计数锁定UI

This commit is contained in:
iven
2026-06-01 22:42:33 +08:00
parent b3fc066aac
commit 55285b57a7
6 changed files with 261 additions and 70 deletions

View File

@@ -40,21 +40,33 @@ final class Authenticated extends AuthState {
/// 是否需要班级码加入(学生/家长角色)
final bool needsClassCode;
/// 是否正在加载(班级码验证中)
final bool isLoading;
/// 班级码验证错误信息
final String? classCodeError;
const Authenticated({
required this.user,
this.needsRoleSelection = false,
this.needsClassCode = false,
this.isLoading = false,
this.classCodeError,
});
Authenticated copyWith({
User? user,
bool? needsRoleSelection,
bool? needsClassCode,
bool? isLoading,
String? classCodeError,
}) =>
Authenticated(
user: user ?? this.user,
needsRoleSelection: needsRoleSelection ?? this.needsRoleSelection,
needsClassCode: needsClassCode ?? this.needsClassCode,
isLoading: isLoading ?? this.isLoading,
classCodeError: classCodeError,
);
}