完成修复登录缓慢问题-主要接口响应时间决定

完成切换设备机器状态的实时接受和UI实时刷新
完成优化tcp重连的体检,手动切换设备或自动断开后重连的区分
This commit is contained in:
2026-03-05 21:07:33 +08:00
parent 5653c044a1
commit 83a5dc7f32
9 changed files with 357 additions and 57 deletions

View File

@@ -52,7 +52,7 @@ class AuthCubit extends Cubit<AuthState> {
Future<void> loginSuccess(UserEntity user) async {
await storage.saveUser(user);
await tcp.connect(host: TCPConsts.TCP_IP, port: TCPConsts.TCP_PORT);
await _authTcpDatasource.sendAuthPacket(); //包括发送认证包和获取列表和切换函数
// await _authTcpDatasource.sendAuthPacket(); //包括发送认证包和获取列表和切换函数
tcp.startHeartbeat(interval: const Duration(seconds: 4)); //启动心跳
appCubit.setAuth(user);
emit(AuthAuthenticated(user));