diff --git a/src/Snap.Hutao/Snap.Hutao/Resource/Localization/SH.resx b/src/Snap.Hutao/Snap.Hutao/Resource/Localization/SH.resx
index 1212a27d..9cf00f4e 100644
--- a/src/Snap.Hutao/Snap.Hutao/Resource/Localization/SH.resx
+++ b/src/Snap.Hutao/Snap.Hutao/Resource/Localization/SH.resx
@@ -1571,6 +1571,12 @@
无感验证复合 Url 配置成功
+
+ 当前以用户身份运行
+
+
+ 当前以管理员身份运行
+
设置数据目录成功,重启以应用更改
@@ -2229,7 +2235,7 @@
创建
- 在桌面上创建默认以管理员方式启动的快捷方式
+ 在桌面上创建默认以管理员身份启动的快捷方式
创建快捷方式
@@ -2273,6 +2279,15 @@
设备 IP
+
+ 管理员模式会影响部分功能的可用性
+
+
+ 管理员模式
+
+
+ 以管理员身份重启
+
在祈愿记录页面显示或隐藏无记录的历史祈愿活动
diff --git a/src/Snap.Hutao/Snap.Hutao/View/Page/SettingPage.xaml b/src/Snap.Hutao/Snap.Hutao/View/Page/SettingPage.xaml
index f9e3eb16..088f95c8 100644
--- a/src/Snap.Hutao/Snap.Hutao/View/Page/SettingPage.xaml
+++ b/src/Snap.Hutao/Snap.Hutao/View/Page/SettingPage.xaml
@@ -181,14 +181,26 @@
HeaderIcon="{shcm:FontIcon Glyph=}"
IsClickEnabled="True"/>
-
-
+
+ IsExpanded="True">
+
+
+
+
+
LocalSetting.Set(SettingKeys.IsAllocConsoleDebugModeEnabled, value);
}
+ public string ElevatedModeHeader
+ {
+ get => HutaoOptions.IsElevated
+ ? SH.ViewModelSettingRunningInElevatedMode
+ : SH.ViewModelSettingNotRunningInElevatedMode;
+ }
+
protected override async ValueTask InitializeUIAsync()
{
CacheFolderView = new(taskContext, runtimeOptions.LocalCache);
@@ -281,4 +289,18 @@ internal sealed partial class SettingViewModel : Abstraction.ViewModel
infoBarService.Warning(SH.ViewModelSettingCreateDesktopShortcutFailed);
}
}
+
+ [Command("RestartAsElevatedCommand")]
+ private void RestartAsElevated()
+ {
+ ProcessStartInfo info = new()
+ {
+ FileName = $"shell:AppsFolder\\{runtimeOptions.FamilyName}!App",
+ UseShellExecute = true,
+ Verb = "runas",
+ };
+
+ Process.Start(info);
+ Process.GetCurrentProcess().Kill();
+ }
}
\ No newline at end of file