diff --git a/RustTools/ApiFox/user.cs b/RustTools/ApiFox/user.cs index 279deca..1e36efc 100644 --- a/RustTools/ApiFox/user.cs +++ b/RustTools/ApiFox/user.cs @@ -7,6 +7,7 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; using RustTools.muqing; using RustTools.Views; +using static IniHelper; namespace RustTools.ApiFox; @@ -70,6 +71,12 @@ public class user return task; } + /// + /// 激活用户 + /// + /// + /// + /// public static async Task enableAccount(string account, string key) { var task = await wl.postAsync("/php/user.php?action=enableAccount", new string[][] @@ -80,4 +87,43 @@ public class user return task; } + + /// + /// 修改密码 发送邮箱验证码 + /// + /// + /// + public static async Task requestChangePassword(string account) + { + var pattern = @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"; + var v = Regex.IsMatch(account, pattern); + var task = await wl.postAsync("/php/user.php?action=requestChangePassword", new string[][] + { + new []{ "account",account}, + new []{ "isEmail", v.ToString().ToLower()} + }); + return task; + } + + /// + /// 修改密码 + /// + /// + /// + /// + /// + public static async Task changePassword(string account, string newPassword, string code) + { + var pattern = @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"; + var v = Regex.IsMatch(account, pattern); + var task = await wl.postAsync("/php/user.php?action=changePassword", new string[][] + { + new []{ "account",account}, + new []{ "isEmail", v.ToString().ToLower()}, + new []{ "code", code}, + new []{ "newPassword", newPassword} + }); + return task; + } + } diff --git a/RustTools/Assets/WindowIcon.ico b/RustTools/Assets/WindowIcon.ico index b6c9dd1..f66504c 100644 Binary files a/RustTools/Assets/WindowIcon.ico and b/RustTools/Assets/WindowIcon.ico differ diff --git a/RustTools/MainWindow.xaml.cs b/RustTools/MainWindow.xaml.cs index 4f1bd48..8b22a21 100644 --- a/RustTools/MainWindow.xaml.cs +++ b/RustTools/MainWindow.xaml.cs @@ -14,11 +14,11 @@ public sealed partial class MainWindow : WindowEx { InitializeComponent(); gj.SetBackTheme(this); - AppWindow.SetIcon(Path.Combine(AppContext.BaseDirectory, "Assets/WindowIcon.ico")); - //AppWindow.SetIcon(Path.Combine(AppContext.BaseDirectory, "Assets/Icon.ico")); Content = null; + ExtendsContentIntoTitleBar = true; + this.SetIcon("Assets/WindowIcon.ico"); + //AppWindow.SetIcon(Path.Combine(AppContext.BaseDirectory, "Assets/WindowIcon.ico")); Title = "AppDisplayName".GetLocalized(); - // Theme change code picked from https://github.com/microsoft/WinUI-Gallery/pull/1239 dispatcherQueue = Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread(); settings.ColorValuesChanged += Settings_ColorValuesChanged; diff --git a/RustTools/RustTools.csproj b/RustTools/RustTools.csproj index c018940..0e04d26 100644 --- a/RustTools/RustTools.csproj +++ b/RustTools/RustTools.csproj @@ -29,8 +29,22 @@ True Never D:\RustTools - + + + + + + + + + @@ -51,6 +65,8 @@ + + Always @@ -60,5 +76,5 @@ - + \ No newline at end of file diff --git a/RustTools/Themes/LoginPage.xaml b/RustTools/Themes/LoginPage.xaml index a2e4ee4..6de3903 100644 --- a/RustTools/Themes/LoginPage.xaml +++ b/RustTools/Themes/LoginPage.xaml @@ -1,4 +1,5 @@ + + @@ -30,6 +35,11 @@ PlaceholderText="密码" /> +