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 Mapster;
using SqlSugar; using SqlSugar;
using Volo.Abp.Auditing; using Volo.Abp.Auditing;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
using Yi.AuditLogging.SqlSugarCore.Entities; 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 Volo.Abp.Modularity;
using Yi.Framework.SqlSugarCore; using Yi.Framework.SqlSugarCore;
@@ -10,7 +13,9 @@ namespace Yi.AuditLogging.SqlSugarCore
{ {
public override void ConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context)
{ {
context.Services.Replace(new ServiceDescriptor(typeof(IAuditLogRepository), typeof(SqlSugarCoreAuditLogRepository), lifetime: ServiceLifetime.Transient));
context.Services.AddYiDbContext<YiAuditLoggingDbContext>(); context.Services.AddYiDbContext<YiAuditLoggingDbContext>();
} }
} }
} }

View File

@@ -18,5 +18,13 @@ namespace Yi.Framework.Bbs.Application.Services
{ {
return Task.FromResult("你好世界"); 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 public class FileService : ApplicationService, IFileService
{ {
private readonly IRepository<FileAggregateRoot> _repository; private readonly IRepository<FileAggregateRoot> _repository;
private readonly HttpContext _httpContext;
private IGuidGenerator _guidGenerator; private IGuidGenerator _guidGenerator;
public FileService(IRepository<FileAggregateRoot> repository, IHttpContextAccessor httpContextAccessor, IGuidGenerator guidGenerator) public FileService(IRepository<FileAggregateRoot> repository, IGuidGenerator guidGenerator)
{ {
_guidGenerator = guidGenerator; _guidGenerator = guidGenerator;
_repository = repository; _repository = repository;
_httpContext = httpContextAccessor.HttpContext;
} }
/// <summary> /// <summary>

View File

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

View File

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