diff --git a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/ArchiSteamFarmPlus/ASF_BotPage.axaml b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/ArchiSteamFarmPlus/ASF_BotPage.axaml index 157e1f19a..d58fdbfdb 100644 --- a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/ArchiSteamFarmPlus/ASF_BotPage.axaml +++ b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/ArchiSteamFarmPlus/ASF_BotPage.axaml @@ -152,28 +152,31 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - diff --git a/src/ST.Client/UI/Resx/AppResources.Designer.cs b/src/ST.Client/UI/Resx/AppResources.Designer.cs index e73ba264a..bb520fc54 100644 --- a/src/ST.Client/UI/Resx/AppResources.Designer.cs +++ b/src/ST.Client/UI/Resx/AppResources.Designer.cs @@ -2692,6 +2692,15 @@ namespace System.Application.UI.Resx { } } + /// + /// 查找类似 你已经成功通过账号登录导入了你的令牌,请最后在测试一下你的令牌是否可以正常使用,如果无法使用可能导入失败,尝试重新进行导入并且删除掉无效令牌即可。 的本地化字符串。 + /// + public static string LocalAuth_SteamUserImportSuccess { + get { + return ResourceManager.GetString("LocalAuth_SteamUserImportSuccess", resourceCulture); + } + } + /// /// 查找类似 设备ID(uuid): 的本地化字符串。 /// @@ -3026,7 +3035,7 @@ namespace System.Application.UI.Resx { } /// - /// 查找类似 您的身份验证器已被添加到您的Steam账户上并已经成功导入Steam++。这是您的恢复代码,如果您丢失了身份验证器,可以用它从您的账户中删除。请您现在就写下它,并将其放在安全的地方。 的本地化字符串。 + /// 查找类似 您的令牌已被添加到您的Steam账户上并已经成功导入Steam++。这是您的恢复代码,如果您丢失了身份验证器,可以用它从您的账户中删除。请您现在就写下它,并将其放在安全的地方。 的本地化字符串。 /// public static string RecoveryCode_RememberTip { get { diff --git a/src/ST.Client/UI/Resx/AppResources.resx b/src/ST.Client/UI/Resx/AppResources.resx index 587e7c076..ebc4bf060 100644 --- a/src/ST.Client/UI/Resx/AppResources.resx +++ b/src/ST.Client/UI/Resx/AppResources.resx @@ -889,6 +889,9 @@ Steam账号导入 + + 你已经成功通过账号登录导入了你的令牌,请最后在测试一下你的令牌是否可以正常使用,如果无法使用可能导入失败,尝试重新进行导入并且删除掉无效令牌即可。 + 无法将添加身份验证器添加到您的帐户, 请稍后再试。 @@ -971,7 +974,7 @@ 我已经写下了我的恢复代码 - 您的身份验证器已被添加到您的Steam账户上并已经成功导入Steam++。这是您的恢复代码,如果您丢失了身份验证器,可以用它从您的账户中删除。请您现在就写下它,并将其放在安全的地方。 + 您的令牌已被添加到您的Steam账户上并已经成功导入Steam++。这是您的恢复代码,如果您丢失了身份验证器,可以用它从您的账户中删除。请您现在就写下它,并将其放在安全的地方。 刷新 diff --git a/src/ST.Client/UI/ViewModels/Windows/LocalAuthPage/AddAuthWindowViewModel.cs b/src/ST.Client/UI/ViewModels/Windows/LocalAuthPage/AddAuthWindowViewModel.cs index 5c569a26c..372feed1f 100644 --- a/src/ST.Client/UI/ViewModels/Windows/LocalAuthPage/AddAuthWindowViewModel.cs +++ b/src/ST.Client/UI/ViewModels/Windows/LocalAuthPage/AddAuthWindowViewModel.cs @@ -220,8 +220,8 @@ namespace System.Application.UI.ViewModels } } - private Stream? _CaptchaImage; - public Stream? CaptchaImage + private string? _CaptchaImage; + public string? CaptchaImage { get => _CaptchaImage; set => this.RaiseAndSetIfChanged(ref _CaptchaImage, value); @@ -305,6 +305,7 @@ namespace System.Application.UI.ViewModels //ToastService.Current.Notify(_Enroll.Error); } + //已有令牌无法导入 if (_Enroll.Requires2FA == true) { MessageBox.Show(AppResources.LocalAuth_SteamUser_Requires2FA); @@ -312,17 +313,19 @@ namespace System.Application.UI.ViewModels return; } + //频繁登录会需要验证码 if (_Enroll.RequiresCaptcha == true) { CaptchaText = null; CaptchaImage = null; - using var web = new WebClient(); - var bt = web.DownloadData(_Enroll.CaptchaUrl); - using var stream = new MemoryStream(bt); - CaptchaImage = stream; + //using var web = new WebClient(); + //var bt = web.DownloadData(_Enroll.CaptchaUrl); + //using var stream = new MemoryStream(bt); + CaptchaImage = _Enroll.CaptchaUrl; return; } + //需要邮箱验证 if (_Enroll.RequiresEmailAuth == true) { RequiresLogin = false; @@ -332,18 +335,13 @@ namespace System.Application.UI.ViewModels return; } + //需要短信验证 此步骤导入还没有结束 if (_Enroll.RequiresActivation == true) { EmailDomain = null; _Enroll.Error = null; RequiresLogin = false; - AuthService.Current.AddOrUpdateSaveAuthenticators(new GAPAuthenticatorDTO - { - Name = nameof(GamePlatform.Steam) + "(" + UserName + ")", - Value = _SteamAuthenticator - }, AuthIsLocal, AuthPassword); - RequiresActivation = true; RevocationCode = _Enroll.RevocationCode; return; @@ -362,8 +360,20 @@ namespace System.Application.UI.ViewModels MessageBox.Show(_Enroll.Error!); return; } - RequiresActivation = false; - RequiresAdd = true; + else + { + RequiresActivation = false; + RequiresAdd = true; + + //导入成功,添加令牌 + AuthService.Current.AddOrUpdateSaveAuthenticators(new GAPAuthenticatorDTO + { + Name = nameof(GamePlatform.Steam) + "(" + UserName + ")", + Value = _SteamAuthenticator + }, AuthIsLocal, AuthPassword); + + Toast.Show(AppResources.LocalAuth_SteamUserImportSuccess); + } }).ContinueWith(s => { Log.Error(nameof(AddAuthWindowViewModel), s.Exception, nameof(LoginSteamImport)); diff --git a/src/ST.Services.CloudService/Models/GAPAuthenticators/Values/SteamAuthenticator.Compat_WinAuth3.cs b/src/ST.Services.CloudService/Models/GAPAuthenticators/Values/SteamAuthenticator.Compat_WinAuth3.cs index a07e6990a..958002c57 100644 --- a/src/ST.Services.CloudService/Models/GAPAuthenticators/Values/SteamAuthenticator.Compat_WinAuth3.cs +++ b/src/ST.Services.CloudService/Models/GAPAuthenticators/Values/SteamAuthenticator.Compat_WinAuth3.cs @@ -472,7 +472,7 @@ namespace System.Application.Models state.OAuthToken = null; // force new login state.RequiresLogin = true; state.Cookies = null; - state.Error = "您的Steam帐户必须附有支持短信的电话号码, " + Environment.NewLine + "请到Steam客户端或Steam网站的帐户详细信息添加电话号码。"; + state.Error = "您的Steam帐户必须附有支持短信的手机号码, " + Environment.NewLine + "请到Steam客户端或Steam网站的帐户详细信息添加电话号码。"; return false; } @@ -494,7 +494,7 @@ namespace System.Application.Models state.OAuthToken = null; // force new login state.RequiresLogin = true; state.Cookies = null; - state.Error = "无法发送短信, 检查您的电话已在您的Steam帐户中注册。"; + state.Error = "无法发送短信,检查您的手机号已在您的Steam帐户中注册。"; return false; } if (response.IndexOf("shared_secret") == -1) @@ -582,7 +582,7 @@ namespace System.Application.Models } if (state.RequiresActivation == true) { - state.Error = "注册时出现问题!Steam服务器可能存在问题, 请稍后再试。"; + state.Error = "注册时出现问题!Steam服务器可能存在问题,请稍后再试。"; return false; }