修复用户端令牌失效后的登录恢复
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
// 功能描述:管理通用记录列表的加载、数据和非鉴权错误状态。
|
||||
// 版本:1.1.0
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
import '../../../data/services/api_client.dart';
|
||||
import '../../../domain/models/client_models.dart';
|
||||
|
||||
typedef RecordLoader = Future<List<ClientRecord>> Function();
|
||||
@@ -23,7 +26,8 @@ class RecordListViewModel extends ChangeNotifier {
|
||||
try {
|
||||
_records = await _loader();
|
||||
} catch (error) {
|
||||
_error = error;
|
||||
// 会话失效由统一路由接管,不在列表中重复展示网络错误。
|
||||
if (error is! SessionExpiredException) _error = error;
|
||||
} finally {
|
||||
_loading = false;
|
||||
notifyListeners();
|
||||
|
||||
Reference in New Issue
Block a user