This commit is contained in:
cjd
2025-11-04 21:09:16 +08:00
parent 8260e293c7
commit bb90a020dc
592 changed files with 61749 additions and 27 deletions

View File

@@ -0,0 +1,26 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.IO;
using System.IO.Compression;
namespace DouyinApi.Extensions
{
/// <summary>
/// 将前端UI压缩文件进行解压
/// </summary>
public static class UiFilesZipSetup
{
public static void AddUiFilesZipSetup(this IServiceCollection services, IWebHostEnvironment _env)
{
if (services == null) throw new ArgumentNullException(nameof(services));
string wwwrootFolderPath = Path.Combine(_env.ContentRootPath, "wwwroot");
string zipUiItemFiles = Path.Combine(wwwrootFolderPath, "ui.zip");
if (!File.Exists(Path.Combine(wwwrootFolderPath, "ui", "index.html")))
{
ZipFile.ExtractToDirectory(zipUiItemFiles, wwwrootFolderPath);
}
}
}
}