diff --git a/MementoMori.AssetDownloader/AssetDownloader.cs b/MementoMori.AssetDownloader/AssetDownloader.cs index dd720f3..7db80ae 100644 --- a/MementoMori.AssetDownloader/AssetDownloader.cs +++ b/MementoMori.AssetDownloader/AssetDownloader.cs @@ -215,7 +215,7 @@ private static async Task SendNotification(string message) if (string.IsNullOrEmpty(token) || string.IsNullOrEmpty(chatId)) return; TelegramBotClient botClient = new(token); - await botClient.SendTextMessageAsync(chatId, message); + await botClient.SendMessage(chatId, message); } diff --git a/MementoMori.Maui/App.xaml.cs b/MementoMori.Maui/App.xaml.cs index aeaf730..104876c 100644 --- a/MementoMori.Maui/App.xaml.cs +++ b/MementoMori.Maui/App.xaml.cs @@ -5,8 +5,11 @@ public partial class App : Application public App() { InitializeComponent(); + } - MainPage = new MainPage(); + protected override Window CreateWindow(IActivationState? activationState) + { + return new Window(new MainPage()); } } -} +} \ No newline at end of file diff --git a/MementoMori.Maui/MainPage.xaml b/MementoMori.Maui/MainPage.xaml index adca57c..217a332 100644 --- a/MementoMori.Maui/MainPage.xaml +++ b/MementoMori.Maui/MainPage.xaml @@ -3,6 +3,7 @@ @@ -15,7 +16,7 @@ - + diff --git a/MementoMori.Maui/MauiProgram.cs b/MementoMori.Maui/MauiProgram.cs index 436ab10..76ba864 100644 --- a/MementoMori.Maui/MauiProgram.cs +++ b/MementoMori.Maui/MauiProgram.cs @@ -27,10 +27,11 @@ public static MauiApp CreateMauiApp() .ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); }); Directory.SetCurrentDirectory(FileSystem.Current.AppDataDirectory); - var embeddedFileProvider = new EmbeddedFileProvider(typeof(App).Assembly); + IFileProvider fileProvider = new PhysicalFileProvider(FileSystem.Current.AppDataDirectory); + builder.Services.AddSingleton(fileProvider); - builder.Configuration.AddJsonFile(embeddedFileProvider, "appsettings.json", false, false); - builder.Configuration.AddJsonFile("appsettings.user.json", true, true); + builder.Configuration.AddJsonFile(new EmbeddedFileProvider(typeof(App).Assembly), "appsettings.json", false, false); + builder.Configuration.AddJsonFile(fileProvider, "appsettings.user.json", true, true); builder.Services.AddMauiBlazorWebView(); builder.Services.AddMudServices(); builder.Services.AddMudMarkdownServices(); diff --git a/MementoMori.Maui/MementoMori.Maui.csproj b/MementoMori.Maui/MementoMori.Maui.csproj index ea7394d..dcb1a92 100644 --- a/MementoMori.Maui/MementoMori.Maui.csproj +++ b/MementoMori.Maui/MementoMori.Maui.csproj @@ -2,7 +2,6 @@ net9.0-android - $(TargetFrameworks);net9.0-windows10.0.19041.0 diff --git a/MementoMori.Maui/Platforms/Android/AndroidManifest.xml b/MementoMori.Maui/Platforms/Android/AndroidManifest.xml index b9c7160..acaad84 100644 --- a/MementoMori.Maui/Platforms/Android/AndroidManifest.xml +++ b/MementoMori.Maui/Platforms/Android/AndroidManifest.xml @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/MementoMori.Maui/appsettings.json b/MementoMori.Maui/appsettings.json index 7839661..729edd9 100644 --- a/MementoMori.Maui/appsettings.json +++ b/MementoMori.Maui/appsettings.json @@ -9,7 +9,7 @@ "AuthOption": { "AuthUrl": null, "DeviceToken": "", - "AppVersion": "3.0.0", + "AppVersion": "3.2.2", "OSVersion": "Android OS 13 / API-33 (TKQ1.220829.002/V14.0.12.0.TLACNXM)", "ModelName": "Xiaomi 2203121C" }, @@ -23,6 +23,7 @@ "AutoFreeGacha": true, // 自动免费抽卡 "AutoRankUpCharacter": true // 自动合成角色 }, + "ServerUrl": "http://localhost:5134/", "LocalRaid": { "RewardItems": [ { diff --git a/MementoMori.WebUI/Program.cs b/MementoMori.WebUI/Program.cs index 4b03ac7..80d7f9a 100644 --- a/MementoMori.WebUI/Program.cs +++ b/MementoMori.WebUI/Program.cs @@ -19,6 +19,8 @@ using Ortega.Common.Manager; using MudBlazor; using Refit; +using MagicOnion; +using Microsoft.Extensions.FileProviders; internal class Program { @@ -42,8 +44,11 @@ public static void Main(string[] args) o.IsGlobalModeEnabled = true; }); - builder.Configuration.AddJsonFile("appsettings.other.json", true, true); - builder.Configuration.AddJsonFile("appsettings.user.json", true, true); + IFileProvider physicalProvider = new PhysicalFileProvider(Directory.GetCurrentDirectory()); + builder.Services.AddSingleton(physicalProvider); + + builder.Configuration.AddJsonFile(physicalProvider, "appsettings.other.json", true, true); + builder.Configuration.AddJsonFile(physicalProvider, "appsettings.user.json", true, true); builder.Services.AddMudServices(); builder.Services.AddMudMarkdownServices(); @@ -89,7 +94,7 @@ public static void Main(string[] args) // Configure the HTTP request pipeline. if (!app.Environment.IsDevelopment()) app.UseExceptionHandler("/Error"); - app.UseStaticFiles(); + app.MapStaticAssets(); app.UseAntiforgery(); app.MapRazorComponents() .AddAdditionalAssemblies(typeof(Index).Assembly) diff --git a/MementoMori.WebUI/appsettings.json b/MementoMori.WebUI/appsettings.json index 134ac5f..cc27301 100644 --- a/MementoMori.WebUI/appsettings.json +++ b/MementoMori.WebUI/appsettings.json @@ -9,7 +9,7 @@ "AuthOption": { "ClientKey": "", "DeviceToken": "", - "AppVersion": "3.0.0", + "AppVersion": "3.2.2", "OSVersion": "Android OS 13 / API-33 (TKQ1.220829.002/V14.0.12.0.TLACNXM)", "ModelName": "Xiaomi 2203121C", "AdverisementId": "", @@ -25,6 +25,7 @@ "AutoFreeGacha": true, // 自动免费抽卡 "AutoRankUpCharacter": true // 自动合成角色 }, + "ServerUrl": "http://localhost:5134/", "LocalRaid": { "RewardItems": [ {