feat: 完成bbs头像功能

This commit is contained in:
陈淳
2023-12-28 20:24:49 +08:00
parent 470c908453
commit 469ec71074
15 changed files with 26 additions and 5 deletions

View File

@@ -4,6 +4,7 @@ using System.Net;
using Mapster;
using SqlSugar;
using Volo.Abp.Auditing;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Repositories;
using Yi.AuditLogging.SqlSugarCore.Entities;

View File

@@ -1,4 +1,7 @@
using Volo.Abp.AuditLogging;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Volo.Abp.AuditLogging;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.Modularity;
using Yi.Framework.SqlSugarCore;
@@ -10,7 +13,9 @@ namespace Yi.AuditLogging.SqlSugarCore
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.Replace(new ServiceDescriptor(typeof(IAuditLogRepository), typeof(SqlSugarCoreAuditLogRepository), lifetime: ServiceLifetime.Transient));
context.Services.AddYiDbContext<YiAuditLoggingDbContext>();
}
}
}

View File

@@ -18,5 +18,13 @@ namespace Yi.Framework.Bbs.Application.Services
{
return Task.FromResult("你好世界");
}
public List<string> GetIcon()
{
return Directory.GetFiles("wwwroot/icon").Select(x => "wwwroot/icon/"+ Path.GetFileName(x)).ToList();
}
}
}

View File

@@ -21,13 +21,11 @@ namespace Yi.Framework.Rbac.Application.Services
public class FileService : ApplicationService, IFileService
{
private readonly IRepository<FileAggregateRoot> _repository;
private readonly HttpContext _httpContext;
private IGuidGenerator _guidGenerator;
public FileService(IRepository<FileAggregateRoot> repository, IHttpContextAccessor httpContextAccessor, IGuidGenerator guidGenerator)
public FileService(IRepository<FileAggregateRoot> repository, IGuidGenerator guidGenerator)
{
_guidGenerator = guidGenerator;
_repository = repository;
_httpContext = httpContextAccessor.HttpContext;
}
/// <summary>

View File

@@ -27,6 +27,9 @@
<Content Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\icon\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
@@ -37,7 +40,7 @@
<ItemGroup>
<Folder Include="logs\" />
<Folder Include="wwwroot\" />
<Folder Include="wwwroot\icon\" />
</ItemGroup>
</Project>

View File

@@ -1,5 +1,6 @@
using System.Text;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Cors;
using Microsoft.IdentityModel.Tokens;
using Microsoft.OpenApi.Models;
@@ -150,6 +151,11 @@ namespace Yi.Abp.Web
//swagger
app.UseYiSwagger();
//静态资源
app.UseStaticFiles("/api/app/wwwroot");
app.UseDefaultFiles();
app.UseDirectoryBrowser("/api/app/wwwroot");
//工作单元
app.UseUnitOfWork();

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB