aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Startup.cs
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-07-23 16:47:53 +0800
committer杨宇千 <crupest@outlook.com>2019-07-23 16:47:53 +0800
commit6191dbfdfa4f048e2f5a78729b49c8cf8a654ae3 (patch)
tree2740cfa1964024d080d1b842b20e918a3e8d8981 /Timeline/Startup.cs
parent918b685ad99a5abd430c9f9ae5a18bd296a32df9 (diff)
downloadtimeline-6191dbfdfa4f048e2f5a78729b49c8cf8a654ae3.tar.gz
timeline-6191dbfdfa4f048e2f5a78729b49c8cf8a654ae3.tar.bz2
timeline-6191dbfdfa4f048e2f5a78729b49c8cf8a654ae3.zip
WIP: Develop UserService. Remove unused components.
Diffstat (limited to 'Timeline/Startup.cs')
-rw-r--r--Timeline/Startup.cs12
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();
}