Browse Source

Merge pull request #1204 from colinin/fix-qrcode-login-avatar

fix(account): 修复二维码登录时无法获取头像
pull/1211/head
yx lin 10 months ago
committed by GitHub
parent
commit
a7c8102dd6
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 31
      aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.Configure.cs
  2. 5
      aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.cs
  3. 7
      aspnet-core/services/LY.MicroService.AuthServer/LY.MicroService.AuthServer.csproj
  4. BIN
      aspnet-core/services/LY.MicroService.AuthServer/openiddict.pfx

31
aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.Configure.cs

@ -1,4 +1,5 @@
using DotNetCore.CAP;
using LINGYUN.Abp.BlobStoring.OssManagement;
using LINGYUN.Abp.Localization.CultureMap;
using LINGYUN.Abp.LocalizationManagement;
using LINGYUN.Abp.OpenIddict.AspNetCore.Session;
@ -9,6 +10,7 @@ using LINGYUN.Abp.OpenIddict.WeChat;
using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.WeChat.Work;
using LINGYUN.Abp.Wrapper;
using Medallion.Threading;
using Medallion.Threading.Redis;
using Microsoft.AspNetCore.Authentication;
@ -34,9 +36,11 @@ using System.Text.Unicode;
using Volo.Abp.Account.Localization;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Auditing;
using Volo.Abp.BlobStoring;
using Volo.Abp.Caching;
using Volo.Abp.FeatureManagement;
using Volo.Abp.GlobalFeatures;
using Volo.Abp.Http.Client;
using Volo.Abp.Json;
using Volo.Abp.Json.SystemTextJson;
using Volo.Abp.Localization;
@ -212,6 +216,20 @@ public partial class AuthServerModule
}
}
private void ConfigureBlobStoring(IConfiguration configuration)
{
Configure<AbpBlobStoringOptions>(options =>
{
options.Containers.ConfigureAll((containerName, containerConfiguration) =>
{
containerConfiguration.UseOssManagement(config =>
{
configuration.GetSection("OssManagement").Bind(config);
});
});
});
}
private void ConfigureCaching(IConfiguration configuration)
{
Configure<AbpDistributedCacheOptions>(options =>
@ -399,4 +417,17 @@ public partial class AuthServerModule
});
});
}
private void PreConfigureWrapper()
{
PreConfigure<AbpHttpClientBuilderOptions>(options =>
{
// http服务间调用发送不需要包装结果的请求头
options.ProxyClientActions.Add(
(_, _, client) =>
{
client.DefaultRequestHeaders.TryAddWithoutValidation(AbpHttpWrapConsts.AbpDontWrapResult, "true");
});
});
}
}

5
aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.cs

@ -5,6 +5,7 @@ using LINGYUN.Abp.AspNetCore.Mvc.Wrapper;
using LINGYUN.Abp.AuditLogging.Elasticsearch;
using LINGYUN.Abp.Authentication.QQ;
using LINGYUN.Abp.Authentication.WeChat;
using LINGYUN.Abp.BlobStoring.OssManagement;
using LINGYUN.Abp.Data.DbMigrator;
using LINGYUN.Abp.Emailing.Platform;
using LINGYUN.Abp.EventBus.CAP;
@ -15,6 +16,7 @@ using LINGYUN.Abp.Identity.AspNetCore.Session;
using LINGYUN.Abp.Identity.OrganizaztionUnits;
using LINGYUN.Abp.Identity.Session.AspNetCore;
using LINGYUN.Abp.Localization.CultureMap;
using LINGYUN.Abp.OpenIddict.AspNetCore;
using LINGYUN.Abp.OpenIddict.AspNetCore.Session;
using LINGYUN.Abp.OpenIddict.LinkUser;
using LINGYUN.Abp.OpenIddict.Portal;
@ -48,6 +50,7 @@ namespace LY.MicroService.AuthServer;
typeof(AbpAccountApplicationModule),
typeof(AbpAccountHttpApiModule),
typeof(AbpAccountWebOpenIddictModule),
typeof(AbpBlobStoringOssManagementModule),
typeof(AbpGdprApplicationModule),
typeof(AbpGdprHttpApiModule),
typeof(AbpGdprWebModule),
@ -87,6 +90,7 @@ public partial class AuthServerModule : AbpModule
var hostingEnvironment = context.Services.GetHostingEnvironment();
PreConfigureAuth();
PreConfigureWrapper();
PreConfigureFeature();
PreForwardedHeaders();
PreConfigureApp(configuration);
@ -99,6 +103,7 @@ public partial class AuthServerModule : AbpModule
var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration();
ConfigureBlobStoring(configuration);
ConfigureCaching(configuration);
ConfigureIdentity(configuration);
ConfigureVirtualFileSystem();

7
aspnet-core/services/LY.MicroService.AuthServer/LY.MicroService.AuthServer.csproj

@ -80,6 +80,7 @@
<ProjectReference Include="..\..\modules\openIddict\LINGYUN.Abp.OpenIddict.Sms\LINGYUN.Abp.OpenIddict.Sms.csproj" />
<ProjectReference Include="..\..\modules\openIddict\LINGYUN.Abp.OpenIddict.WeChat.Work\LINGYUN.Abp.OpenIddict.WeChat.Work.csproj" />
<ProjectReference Include="..\..\modules\openIddict\LINGYUN.Abp.OpenIddict.WeChat\LINGYUN.Abp.OpenIddict.WeChat.csproj" />
<ProjectReference Include="..\..\modules\oss-management\LINGYUN.Abp.BlobStoring.OssManagement\LINGYUN.Abp.BlobStoring.OssManagement.csproj" />
<ProjectReference Include="..\..\modules\platform\LINGYUN.Abp.Emailing.Platform\LINGYUN.Abp.Emailing.Platform.csproj" />
<ProjectReference Include="..\..\modules\platform\LINGYUN.Abp.Sms.Platform\LINGYUN.Abp.Sms.Platform.csproj" />
</ItemGroup>
@ -88,4 +89,10 @@
<Folder Include="wwwroot\libs\jquery\" />
</ItemGroup>
<ItemGroup>
<None Update="openiddict.pfx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

BIN
aspnet-core/services/LY.MicroService.AuthServer/openiddict.pfx

Binary file not shown.
Loading…
Cancel
Save