Files
qhmes/yy-admin-master/YY.Admin/Views/SysManage/LoginSettingsView.xaml

113 lines
7.5 KiB
Plaintext
Raw Normal View History

<UserControl x:Class="YY.Admin.Views.SysManage.LoginSettingsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:prism="http://prismlibrary.com/"
mc:Ignorable="d"
d:DesignHeight="560" d:DesignWidth="980"
prism:ViewModelLocator.AutoWireViewModel="True">
<Grid Style="{StaticResource BaseViewStyle}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" Margin="0,0,0,12">
<hc:UniformSpacingPanel Spacing="10">
<ToggleButton IsChecked="{Binding NeverExpire, Mode=TwoWay}" MinWidth="110" Height="32" Padding="12,0">
<TextBlock Text="永不过期"/>
</ToggleButton>
<Button Style="{StaticResource ButtonDefault}" Command="{Binding LoadCommand}">
<StackPanel Orientation="Horizontal">
<md:PackIcon Kind="Refresh"/>
<TextBlock Text="重新加载" Style="{StaticResource IconButtonStyle}"/>
</StackPanel>
</Button>
<Button Style="{StaticResource ButtonPrimary}" Command="{Binding SaveCommand}">
<StackPanel Orientation="Horizontal">
<md:PackIcon Kind="ContentSaveOutline"/>
<TextBlock Text="保存" Style="{StaticResource IconButtonStyle}"/>
</StackPanel>
</Button>
</hc:UniformSpacingPanel>
</Border>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<StackPanel MaxWidth="980">
<TextBlock TextWrapping="Wrap" Margin="0,0,0,16" Opacity="0.85"
Text="以下参数保存在本地库 sys_config 中,保存后立即影响新登录与当前会话的续期逻辑;检查间隔会立即应用到已运行的登录状态定时器。开启“永不过期”后,下方参数将锁定为只读,且系统不再弹出登录超时重新登录提示。"/>
<StackPanel IsEnabled="{Binding IsConfigEditable}">
<Border CornerRadius="4" Padding="16" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1">
<hc:Row>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=12, Lg=12, Xl=12}">
<TextBlock FontWeight="SemiBold" Text="会话与检查" Margin="0,0,0,8"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=6, Lg=6, Xl=6}">
<hc:NumericUpDown Value="{Binding TokenExpireMinutes, Mode=TwoWay}"
Minimum="5" Maximum="43200" DecimalPlaces="0"
hc:InfoElement.Title="Token 过期时间"
hc:InfoElement.TitleWidth="140"
hc:InfoElement.TitlePlacement="Left"
Style="{StaticResource NumericUpDownPlus}"
Margin="0,0,0,12"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=6, Lg=6, Xl=6}">
<hc:NumericUpDown Value="{Binding IdleExtendMinutes, Mode=TwoWay}"
Minimum="1" Maximum="1440" DecimalPlaces="0"
hc:InfoElement.Title="操作时续期阈值"
hc:InfoElement.TitleWidth="140"
hc:InfoElement.TitlePlacement="Left"
Style="{StaticResource NumericUpDownPlus}"
Margin="0,0,0,12"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=12, Lg=12, Xl=12}">
<TextBlock TextWrapping="Wrap" Opacity="0.75" Margin="0,-4,0,12"
Text="用户有鼠标或键盘操作时若距离过期不足「续期阈值」分钟则将过期时间重新延长为「Token 过期时间」整段。"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=6, Lg=6, Xl=6}">
<hc:NumericUpDown Value="{Binding CheckIntervalMinutes, Mode=TwoWay}"
Minimum="1" Maximum="120" DecimalPlaces="0"
hc:InfoElement.Title="状态检查间隔"
hc:InfoElement.TitleWidth="140"
hc:InfoElement.TitlePlacement="Left"
Style="{StaticResource NumericUpDownPlus}"
Margin="0,0,0,12"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=12, Lg=12, Xl=12}">
<TextBlock TextWrapping="Wrap" Opacity="0.75" Margin="0,-4,0,0"
Text="桌面端定时检查登录是否仍有效的间隔(分钟)。间隔越大,过期后提示可能越晚出现。"/>
</hc:Col>
</hc:Row>
</Border>
<Border CornerRadius="4" Padding="12" Margin="0,16,0,0" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1">
<hc:Row>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=12, Lg=12, Xl=12}">
<TextBlock FontWeight="SemiBold" Text="RefreshToken分钟" Margin="0,0,0,8"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=12, Lg=12, Xl=12}">
<hc:NumericUpDown Value="{Binding RefreshTokenExpireMinutes, Mode=TwoWay}"
Minimum="60" Maximum="999999" DecimalPlaces="0"
hc:InfoElement.Title="过期时间"
hc:InfoElement.TitleWidth="140"
hc:InfoElement.TitlePlacement="Left"
Style="{StaticResource NumericUpDownPlus}"
Margin="0,0,0,8"/>
</hc:Col>
<hc:Col Layout="{hc:ColLayout Xs=12, Sm=12, Md=12, Lg=12, Xl=12}">
<TextBlock TextWrapping="Wrap" Opacity="0.75"
Text="与 Web 端约定一致,建议 ≥ 2 × Token 过期时间。当前桌面端内存会话主要受「Token 过期时间」控制,此项仍写入配置供扩展或对接使用。"/>
</hc:Col>
</hc:Row>
</Border>
</StackPanel>
</StackPanel>
</ScrollViewer>
</Grid>
</UserControl>