Browse Source

优化用户权限

KWD 3 tháng trước cách đây
mục cha
commit
aef72a0039

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

@@ -599,7 +599,9 @@ namespace TeamAAS_VP.ViewModels
                 await _systemDatabaseService.SetCurrentUserAsync(operatorUser.Id);
                 _eventAggregator.GetEvent<CurrentStatusNotification>().Publish();
                 _eventAggregator.GetEvent<UserLoginNotification>().Publish(_systemDatabaseService.GetCurrentUser());
-
+                _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

@@ -1399,7 +1399,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;
             }