diff --git a/lib/core/logger.dart b/lib/core/logger.dart index a1d30ea..fc9ffc6 100644 --- a/lib/core/logger.dart +++ b/lib/core/logger.dart @@ -34,7 +34,7 @@ class SimpleLogPrinter extends LogPrinter { } String formatStackTrace(StackTrace stackTrace, int methodPosition) { - var lines = stackTrace.toString().split('\n'); + var lines = stackTrace.toString()?.split('\n'); var formatted = []; var count = 0; for (var line in lines) { diff --git a/lib/core/services/DataService.dart b/lib/core/services/DataService.dart index 781d672..c28b250 100644 --- a/lib/core/services/DataService.dart +++ b/lib/core/services/DataService.dart @@ -200,8 +200,8 @@ class DataService extends BaseService { try { String token = user.token; Response goods = await _api.getGoodsFromServer(token); - if(goods.operation==false){ - log.w('session is closed'); + if(goods.operation==false && [401,402,403,412].contains(goods.status)){ + log.i('session is closed'); return false; } Response categories = await _api.getCategoryFromServer(token); diff --git a/lib/redux/store.dart b/lib/redux/store.dart index 1c34fdf..8519399 100644 --- a/lib/redux/store.dart +++ b/lib/redux/store.dart @@ -70,7 +70,6 @@ class AppState { } static AppState fromJson(dynamic json){ - print(json); return json !=null ? AppState( settingState: SettingState.fromJson(json['settingState']),