Browse Source

fix 0016609: 【APP】【登录】晚上登录着账号,平板息屏,第二天未自动退出登录,网络显示正常,但居民列表为空,实际未连上server

warr.qian 1 year ago
parent
commit
852a0449dc
1 changed files with 32 additions and 2 deletions
  1. 32 2
      lib/store/modules/user.dart

+ 32 - 2
lib/store/modules/user.dart

@@ -187,6 +187,21 @@ class UserState extends StateModuleBase {
         }
       },
     );
+    map.pickPersistentProp('selectPatientInfo', (x) {
+      if (x != null) {
+        _updateSelectPatientInfo(PatientDTO.fromJson(x));
+      }
+    });
+    map.pickPersistentProp('menuPermissionList', (x) {
+      if (x != null) {
+        _updateMenuPermissionList((x as List).cast<UserFeatureDTO>());
+      }
+    });
+    map.pickPersistentProp('operationPermissionList', (x) {
+      if (x != null) {
+        _updateOperationPermissionList((x as List).cast<UserFeatureDTO>());
+      }
+    });
   }
 
   @override
@@ -199,11 +214,26 @@ class UserState extends StateModuleBase {
       "displayName": displayName,
       "userInfo": _userInfo,
       "features": _features,
+      "selectPatientInfo": _currentSelectPatientInfo,
+      "menuPermissionList": _menuPermissionList,
+      "operationPermissionList": _operationPermissionList,
     };
   }
 
-  void _updateFeatures(Iterable<String> keys) {
-    _features.value = List.unmodifiable(keys);
+  void _updateFeatures(Iterable<String> features) {
+    _features.value = List.unmodifiable(features);
+  }
+
+  void _updateMenuPermissionList(Iterable<UserFeatureDTO> permissionList) {
+    _menuPermissionList.value = List.unmodifiable(permissionList);
+  }
+
+  void _updateOperationPermissionList(Iterable<UserFeatureDTO> permissionList) {
+    _operationPermissionList.value = List.unmodifiable(permissionList);
+  }
+
+  void _updateSelectPatientInfo(PatientDTO patient) {
+    _currentSelectPatientInfo.value = patient;
   }
 
   void _clearFeatures() => _features.value = [];