This commit is contained in:
Lightczx
2023-11-02 12:45:11 +08:00
parent 1cc072ba28
commit 067c7d7c4d
3 changed files with 11 additions and 12 deletions

View File

@@ -1,6 +1,10 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="WebViewerFlyoutPresenterStyle" TargetType="FlyoutPresenter">
<Style
x:Key="WebViewerFlyoutPresenterStyle"
BasedOn="{StaticResource DefaultFlyoutPresenterStyle}"
TargetType="FlyoutPresenter">
<Setter Property="Padding" Value="0"/>
<Setter Property="CornerRadius" Value="0"/>
<Setter Property="BorderBrush" Value="{ThemeResource CardStrokeColorDefaultBrush}"/>
</Style>
<Style

View File

@@ -32,19 +32,19 @@ internal sealed partial class HutaoUserService : IHutaoUserService, IHutaoUserSe
public async ValueTask InitializeInternalAsync(CancellationToken token = default)
{
string userName = LocalSetting.Get(SettingKeys.PassportUserName, string.Empty);
string passport = LocalSetting.Get(SettingKeys.PassportPassword, string.Empty);
string password = LocalSetting.Get(SettingKeys.PassportPassword, string.Empty);
if (string.IsNullOrEmpty(userName) || string.IsNullOrEmpty(passport))
if (string.IsNullOrEmpty(userName) || string.IsNullOrEmpty(password))
{
options.SkipLogin();
}
else
{
Web.Response.Response<string> response = await passportClient.LoginAsync(userName, passport, token).ConfigureAwait(false);
Web.Response.Response<string> response = await passportClient.LoginAsync(userName, password, token).ConfigureAwait(false);
if (response.IsOk())
{
if (await options.PostLoginSucceedAsync(passportClient, taskContext, userName, token: response.Data).ConfigureAwait(false))
if (await options.PostLoginSucceedAsync(passportClient, taskContext, userName, password, response.Data).ConfigureAwait(false))
{
isInitialized = true;
}

View File

@@ -189,19 +189,14 @@
Style="{StaticResource DefaultAppBarButtonStyle}">
<AppBarButton.Flyout>
<Flyout
FlyoutPresenterStyle="{StaticResource WebViewerFlyoutPresenterStyle}"
LightDismissOverlayMode="On"
Placement="Full"
ShouldConstrainToRootBounds="False">
<Flyout.FlyoutPresenterStyle>
<Style BasedOn="{StaticResource DefaultFlyoutPresenterStyle}" TargetType="FlyoutPresenter">
<Setter Property="Padding" Value="0"/>
<Setter Property="CornerRadius" Value="0"/>
</Style>
</Flyout.FlyoutPresenterStyle>
<Grid>
<shvc:WebViewer>
<shvc:WebViewer.SourceProvider>
<shvc:StaticWebview2ViewerSource ChineseSource="https://webstatic.mihoyo.com/app/community-game-records/index.html"/>
<shvc:StaticWebview2ViewerSource ChineseSource="https://webstatic.mihoyo.com/bbs/event/e20200511toolbox/index.html?game_biz=ys_cn"/>
</shvc:WebViewer.SourceProvider>
</shvc:WebViewer>
</Grid>