diff --git a/src/TelegramPanel.Web/Components/Pages/Accounts.razor b/src/TelegramPanel.Web/Components/Pages/Accounts.razor index 9835174..fbbb826 100644 --- a/src/TelegramPanel.Web/Components/Pages/Accounts.razor +++ b/src/TelegramPanel.Web/Components/Pages/Accounts.razor @@ -958,7 +958,8 @@ return; var qs = string.Join(",", ids); - Navigation.NavigateTo($"/downloads/accounts.zip?ids={qs}&format={format}", forceLoad: true); + var ts = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); + Navigation.NavigateTo($"/downloads/accounts.zip?ids={qs}&format={format}&ts={ts}", forceLoad: true); } private async Task SelectExportFormatAsync(int accountCount, string scopeLabel) diff --git a/src/TelegramPanel.Web/Program.cs b/src/TelegramPanel.Web/Program.cs index 463c034..b190113 100644 --- a/src/TelegramPanel.Web/Program.cs +++ b/src/TelegramPanel.Web/Program.cs @@ -864,6 +864,11 @@ var accountsZipDownload = app.MapGet("/downloads/accounts.zip", async ( var zipBytes = await exporter.BuildAccountsZipAsync(accounts, cancellationToken, format); var formatName = format == AccountExportFormat.Tdata ? "tdata" : "telethon"; var fileName = $"telegram-panel-accounts-{formatName}-{DateTime.UtcNow:yyyyMMdd-HHmmss}.zip"; + + // 下载文件禁止缓存,避免浏览器复用旧的 accounts.zip 导致“重复拿到旧导出包”。 + http.Response.Headers.CacheControl = "no-store, no-cache, must-revalidate, max-age=0"; + http.Response.Headers.Pragma = "no-cache"; + http.Response.Headers.Expires = "0"; return Results.File(zipBytes, "application/zip", fileName); }).DisableAntiforgery(); if (adminAuthEnabled)