Prechádzať zdrojové kódy

修改用户登陆逻辑

KWD 3 mesiacov pred
rodič
commit
18a1616fcb

+ 3 - 1
TeamAAS-VM/Core/Management.cs

@@ -3859,7 +3859,9 @@ namespace TeamAAS_VP.Core
             bool mesStatus = IsMesReady();
             bool paraStatus = IsParameterReady();
 
-            if (connectStatus && mesStatus && paraStatus)
+            var curUser = _systemDatabaseService.GetCurrentUser();
+
+            if (connectStatus && mesStatus && paraStatus && curUser.userPart == UserPart.Operator)
             {
                 return RunDisplayMode.Auto;
             }

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

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

+ 1 - 0
TeamAAS-VM/ViewModels/User/LoginViewModel.cs

@@ -200,6 +200,7 @@ namespace TeamAAS_VP.ViewModels.User
 
                     _eventAggregator.GetEvent<SnackbarMessageNotification>().Publish(new MessageParameter() { Msg = $"{Lang.登录成功}!", Duration = 1 });
                     UserPassword = string.Empty;
+                    _eventAggregator.GetEvent<CurrentStatusNotification>().Publish();
                     _eventAggregator.GetEvent<UserLoginNotification>().Publish(_systemDatabaseService.GetCurrentUser());
                 }
             }