mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
minor bug fixes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
|
||||
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -88,7 +88,6 @@ internal static partial class IocHttpClientConfiguration
|
||||
/// HoYoLAB web
|
||||
/// </summary>
|
||||
/// <param name="client">配置后的客户端</param>
|
||||
[SuppressMessage("", "IDE0051")]
|
||||
private static void XRpc4Configuration(HttpClient client)
|
||||
{
|
||||
client.Timeout = Timeout.InfiniteTimeSpan;
|
||||
|
||||
@@ -5,9 +5,15 @@ namespace Snap.Hutao.Model;
|
||||
|
||||
internal static class CollectionsNameValue
|
||||
{
|
||||
public static List<NameValue<T>> ListFromEnum<T>()
|
||||
where T : struct, Enum
|
||||
public static List<NameValue<TEnum>> ListFromEnum<TEnum>()
|
||||
where TEnum : struct, Enum
|
||||
{
|
||||
return Enum.GetValues<T>().Select(x => new NameValue<T>(x.ToString(), x)).ToList();
|
||||
return Enum.GetValues<TEnum>().Select(x => new NameValue<TEnum>(x.ToString(), x)).ToList();
|
||||
}
|
||||
|
||||
public static List<NameValue<TEnum>> ListFromEnum<TEnum>(Func<TEnum, string> nameSelector)
|
||||
where TEnum : struct, Enum
|
||||
{
|
||||
return Enum.GetValues<TEnum>().Select(x => new NameValue<TEnum>(nameSelector(x), x)).ToList();
|
||||
}
|
||||
}
|
||||
@@ -108,7 +108,7 @@
|
||||
</cwc:SettingsExpander>
|
||||
<!--
|
||||
https://github.com/DGP-Studio/Snap.Hutao/issues/1072
|
||||
ItemsRepeater will behave abnormal is no direct scrollhost wrapping it
|
||||
ItemsRepeater will behave abnormal if no direct scrollhost wrapping it
|
||||
-->
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled">
|
||||
<cwc:SettingsExpander
|
||||
@@ -252,8 +252,6 @@
|
||||
VerticalAlignment="Center"
|
||||
IsOn="{Binding HotKeyOptions.MouseClickRepeatForeverKeyCombination.IsEnabled, Mode=TwoWay}"/>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
</cwc:SettingsCard>
|
||||
|
||||
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="{shcm:ResourceString Name=ViewpageSettingHomeHeader}"/>
|
||||
|
||||
@@ -47,7 +47,7 @@ internal static class StaticResource
|
||||
{
|
||||
{ "AchievementIcon", 1 },
|
||||
{ "AvatarCard", 0 },
|
||||
{ "AvatarIcon", 1 },
|
||||
{ "AvatarIcon", 2 },
|
||||
{ "Bg", 1 },
|
||||
{ "ChapterIcon", 0 },
|
||||
{ "CodexMonster", 0 },
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
namespace Snap.Hutao.Web.Hoyolab.DataSigning;
|
||||
|
||||
/// <summary>
|
||||
/// 动态密钥版本
|
||||
/// 数据签名版本
|
||||
/// </summary>
|
||||
[HighQuality]
|
||||
internal enum DataSignAlgorithmVersion
|
||||
|
||||
@@ -15,8 +15,13 @@ internal static class HttpRequestMessageBuilderExtension
|
||||
{
|
||||
try
|
||||
{
|
||||
HttpResponseMessage message = await httpClient.SendAsync(builder.HttpRequestMessage, token).ConfigureAwait(false);
|
||||
return await builder.HttpContentSerializer.DeserializeAsync<TResult>(message.Content, token).ConfigureAwait(false);
|
||||
using (builder.HttpRequestMessage)
|
||||
{
|
||||
using (HttpResponseMessage message = await httpClient.SendAsync(builder.HttpRequestMessage, token).ConfigureAwait(false))
|
||||
{
|
||||
return await builder.HttpContentSerializer.DeserializeAsync<TResult>(message.Content, token).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (HttpRequestException ex)
|
||||
{
|
||||
@@ -49,7 +54,9 @@ internal static class HttpRequestMessageBuilderExtension
|
||||
{
|
||||
try
|
||||
{
|
||||
HttpResponseMessage message = await httpClient.SendAsync(builder.HttpRequestMessage, token).ConfigureAwait(false);
|
||||
using (HttpResponseMessage message = await httpClient.SendAsync(builder.HttpRequestMessage, token).ConfigureAwait(false))
|
||||
{
|
||||
}
|
||||
}
|
||||
catch (HttpRequestException ex)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Web.Request.Builder.Abstraction;
|
||||
|
||||
namespace Snap.Hutao.Web.Request.Builder;
|
||||
|
||||
internal static class HttpRequestMessageBuilderFactoryExtension
|
||||
{
|
||||
public static HttpRequestMessageBuilder Create(this IHttpRequestMessageBuilderFactory factory, string requestUri)
|
||||
{
|
||||
return factory.Create().SetRequestUri(requestUri);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user