Remove loginproxy http request

This commit is contained in:
summpot 2021-08-13 11:54:16 +08:00
parent 6772770bab
commit b251677b85
2 changed files with 3 additions and 32 deletions

View File

@ -5,8 +5,6 @@ namespace Pixeval.LoginProxy
{
public partial class App
{
public static int Port;
public static string? Culture;
// reserved: public static bool? SignUp;
@ -15,34 +13,7 @@ namespace Pixeval.LoginProxy
{
#if DEBUG
Culture = "zh-CN";
Port = 6133;
#else
if (e.Args.Length >= 2 && int.TryParse(e.Args[0], out _))
{
Culture = e.Args[1];
Port = int.Parse(e.Args[0]);
// reserved: SignUp = e.Args.Length >= 3 && e.Args[2] == "-signUp";
AppDomain.CurrentDomain.UnhandledException += (_, args) =>
{
if (args.ExceptionObject is PixivWebLoginException webLoginException)
{
Interop.PostJsonToPixevalClient("/login/token", new LoginTokenRequest
{
Errno = (int) webLoginException.Reason
}).ContinueWith(t =>
{
if (t.Exception is not null || !t.Result.IsSuccessStatusCode)
{
MessageBox.Show("Error when communicating to Pixeval client", "Unexpected Error", MessageBoxButton.OK, MessageBoxImage.Error);
}
}).ContinueWith(_ => Environment.Exit(-1));
}
};
return;
}
MessageBox.Show("Illegal Arguments", "Unexpected Error", MessageBoxButton.OK, MessageBoxImage.Error);
Environment.Exit(-1);
#endif
}

View File

@ -66,9 +66,9 @@
<PackageReference Include="Microsoft.ProjectReunion" Version="0.8.1" />
<PackageReference Include="Microsoft.ProjectReunion.Foundation" Version="0.8.1" />
<PackageReference Include="Microsoft.ProjectReunion.WinUI" Version="0.8.1" />
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.0.2" />
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.0.2" />
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.0-preview1" />
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.0-preview1" />
<PackageReference Include="Microsoft.Win32.Registry" Version="6.0.0-preview.5.21301.5" />
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.4" />
<PackageReference Include="PInvoke.User32" Version="0.7.104" />
<PackageReference Include="System.Linq.Async" Version="5.0.0" />