1.1.1 -> 1.1.2 第49次更新

This commit is contained in:
Space Time 2024-10-07 12:46:51 +08:00
parent 158ee04adc
commit 605c6e61a3

View File

@ -184,6 +184,7 @@ public partial class MainWin : Window
{
if (MessageBox.Show(MainConst._LaunchProxyPrompt, string.Empty, MessageBoxButton.YesNo) != MessageBoxResult.Yes)
return;
if (!File.Exists(MainConst.NginxConfPath))
File.Create(MainConst.NginxConfPath).Dispose();
if (!Directory.Exists(MainConst.NginxLogsPath))
@ -300,8 +301,11 @@ public partial class MainWin : Window
if (!MainPres!.IsMihomoRunning)
{
if (string.IsNullOrWhiteSpace(MihomoConfs))
throw new Exception(MainConst._ConfErrorMsg);
if (MessageBox.Show(MainConst._LaunchProxyPrompt, string.Empty, MessageBoxButton.YesNo) != MessageBoxResult.Yes)
return;
if (!File.Exists(MainConst.MihomoConfPath))
File.Create(MainConst.MihomoConfPath).Dispose();
@ -575,6 +579,8 @@ public partial class MainWin : Window
private void MihomoConfWatcher_Changed(object sender, FileSystemEventArgs e)
{
if (MainConst.IsAdmin && MainPres!.IsMihomoExist)
{
try
{
if (!File.Exists(MainConst.MihomoConfPath))
File.Create(MainConst.MihomoConfPath).Dispose();
@ -606,6 +612,8 @@ public partial class MainWin : Window
MihomoConfs = new SerializerBuilder().WithNamingConvention(HyphenatedNamingConvention.Instance).Build().Serialize(mihomoConfDict);
}
catch { MihomoConfs = string.Empty; }
}
}
private void MainWin_KeyDown(object sender, KeyEventArgs e)
{