Explorar o código

修改用户登陆权限

KWD hai 3 meses
pai
achega
447ead2010

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

@@ -3553,7 +3553,8 @@ namespace TeamAAS_VP.Core
                 //paraStatus = false;
 
             }
-            if (connectStaus && mesStatus && _LastAutoRunning)
+            var user = _systemDatabaseService.GetCurrentUser();
+            if (connectStaus && mesStatus && _LastAutoRunning&& user.userPart == UserPart.Operator)
             {
                 RunModelBackground = System.Windows.Media.Brushes.Green;
                 ClearModeBackground = System.Windows.Media.Brushes.White;

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

@@ -197,6 +197,7 @@ namespace TeamAAS_VP.ViewModels.User
                     // mark current user in system DB and record login
                     await _systemDatabaseService.SetCurrentUserAsync(user.Id);
                     //await _systemDatabaseService.RecordUserLoginAsync(new UserLoginRecord { UserId = user.Id, Success = true, Time = DateTime.UtcNow, Message = "Login success" });
+                    _eventAggregator.GetEvent<CurrentStatusNotification>().Publish();
 
                     _eventAggregator.GetEvent<SnackbarMessageNotification>().Publish(new MessageParameter() { Msg = $"{Lang.登录成功}!", Duration = 1 });
                     UserPassword = string.Empty;

+ 1 - 1
TeamAAS-VM/Views/User/LoginView.xaml

@@ -64,7 +64,7 @@
                     <Grid Grid.Row="3"
                           Height="40"
                           Margin="20,5,20,0">
-                        <CheckBox Content="{lex:Loc 记住用户}"
+                        <!--<CheckBox Content="{lex:Loc 记住用户}"
                                   Foreground="Black"
                                   Style="{StaticResource MaterialDesignCheckBox}"
                                   HorizontalAlignment="Left"