diff options
author | 杨宇千 <crupest@outlook.com> | 2019-07-23 16:47:53 +0800 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-07-23 16:47:53 +0800 |
commit | d088a03986713a71e274fc16144ca42b7f020e3f (patch) | |
tree | 2740cfa1964024d080d1b842b20e918a3e8d8981 /Timeline/Startup.cs | |
parent | 35300c1b1ce6377393d4c9353416daae23b6d17c (diff) | |
download | timeline-d088a03986713a71e274fc16144ca42b7f020e3f.tar.gz timeline-d088a03986713a71e274fc16144ca42b7f020e3f.tar.bz2 timeline-d088a03986713a71e274fc16144ca42b7f020e3f.zip |
WIP: Develop UserService. Remove unused components.
Diffstat (limited to 'Timeline/Startup.cs')
-rw-r--r-- | Timeline/Startup.cs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/Timeline/Startup.cs b/Timeline/Startup.cs index 374b918a..a6965190 100644 --- a/Timeline/Startup.cs +++ b/Timeline/Startup.cs @@ -1,4 +1,3 @@ -using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.HttpOverrides; @@ -9,7 +8,6 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Timeline.Authenticate; using Timeline.Configs; -using Timeline.Formatters; using Timeline.Models; using Timeline.Services; @@ -31,10 +29,7 @@ namespace Timeline // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { - services.AddMvc(options => - { - options.InputFormatters.Add(new StringInputFormatter()); - }).SetCompatibilityVersion(CompatibilityVersion.Version_2_2); + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); services.AddCors(options => { @@ -50,7 +45,7 @@ namespace Timeline services.Configure<JwtConfig>(Configuration.GetSection(nameof(JwtConfig))); var jwtConfig = Configuration.GetSection(nameof(JwtConfig)).Get<JwtConfig>(); - services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) + services.AddAuthentication(AuthConstants.Scheme) .AddScheme<AuthOptions, AuthHandler>(AuthConstants.Scheme, AuthConstants.DisplayName, o => { }); services.AddScoped<IUserService, UserService>(); @@ -73,9 +68,6 @@ namespace Timeline services.AddHttpClient(); - services.Configure<QCloudCosConfig>(Configuration.GetSection(nameof(QCloudCosConfig))); - services.AddSingleton<IQCloudCosService, QCloudCosService>(); - services.AddMemoryCache(); } |