fix: 修复手机连不上服务器时启动页无限转圈(B-58)
- 启动页先读本地凭证:无凭证(首次打开)直接进登录页,不再先等 SDK 初始化 - SDK init/login 加 20s 超时;init 用共享 Future 防止超时后重复触发 initSDK - 登录页对 IM 登录超时给出明确提示(确认手机连着公司内网 WiFi) - 修复 flutter create 模板遗留的 widget_test(引用不存在的 MyApp),改为登录页渲染冒烟测试 - 版本号 1.0.1+2
This commit is contained in:
@@ -78,8 +78,11 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
password: password,
|
||||
platformID: IMService.instance.platformID,
|
||||
);
|
||||
// 2. 登录 OpenIM SDK
|
||||
await IMService.instance.login(userID: result.userID, token: result.token);
|
||||
// 2. 登录 OpenIM SDK(服务器连不上时这一步可能长时间不返回,加超时兜底)
|
||||
await IMService.instance.login(userID: result.userID, token: result.token).timeout(
|
||||
const Duration(seconds: 20),
|
||||
onTimeout: () => throw AuthException('连不上消息服务器,请确认手机连着公司内网 WiFi'),
|
||||
);
|
||||
// 3. 启动通话信令监听
|
||||
CallService.instance.start();
|
||||
// 4. 存凭证用于下次自动登录
|
||||
|
||||
Reference in New Issue
Block a user