Explorar o código

优化用户权限

KWD hai 3 meses
pai
achega
959f939dec

+ 3 - 0
TeamAAS-VM/ViewModels/MainWindowViewModel.cs

@@ -634,6 +634,9 @@ namespace TeamAAS_VP.ViewModels
                 await _systemDatabaseService.SetCurrentUserAsync(operatorUser.Id);
                 _eventAggregator.GetEvent<UserLoginNotification>().Publish(_systemDatabaseService.GetCurrentUser());
                 _eventAggregator.GetEvent<CurrentStatusNotification>().Publish();
+                _regionManager.RequestNavigate("MainRegionContext", "HomeView");
+                NavigationIndex = 0;
+                _eventAggregator.GetEvent<MainTabSwitchNotification>().Publish(NavigationIndex);
                 App.Current.Dispatcher.Invoke(() =>
                 {
                     _eventAggregator.GetEvent<TaskMessageNotification>().Publish(new Models.MessageStruct() { Message = "权限超时,已自动退出工程师/管理员权限", level = MessageLevel.Error });

+ 1 - 1
TeamAAS-VM/ViewModels/SettingViewModel.cs

@@ -1365,7 +1365,7 @@ namespace TeamAAS_VP.ViewModels
         /// <exception cref="NotImplementedException"></exception>
         public async void OnNavigatedTo(NavigationContext navigationContext)
         {
-            if (_systemDatabaseService.GetCurrentUser().userPart == Enums.UserPart.Operator)
+            if (_systemDatabaseService.GetCurrentUser().userPart == Enums.UserPart.Operator|| _systemDatabaseService.GetCurrentUser().userPart == Enums.UserPart.Engineer)
             {
                 IsAllowEdit = false;
             }