| | |
| | | using Microsoft.Extensions.Hosting; |
| | | using SqlSugar; |
| | | using System.Text.Json.Serialization; |
| | | using Yw; |
| | | using Yw.Application; |
| | | |
| | | namespace HStation.WebApi |
| | |
| | | /// </summary> |
| | | public void ConfigureServices(IServiceCollection services) |
| | | { |
| | | LogHelper.Debug("1"); |
| | | services.AddConfigurableOptions<Yw.JWT.JWTSettingsOptions>(); |
| | | |
| | | LogHelper.Debug("2"); |
| | | services.Configure<KestrelServerOptions>(options => |
| | | { |
| | | options.Limits.MaxRequestBodySize = int.MaxValue; |
| | | options.Limits.MaxRequestBufferSize = int.MaxValue; |
| | | options.Limits.MaxResponseBufferSize = int.MaxValue; |
| | | }); |
| | | LogHelper.Debug("3"); |
| | | services.Configure<IISServerOptions>(options => |
| | | { |
| | | options.MaxRequestBodySize = int.MaxValue; |
| | | options.MaxRequestBodyBufferSize = int.MaxValue; |
| | | }); |
| | | |
| | | LogHelper.Debug("4"); |
| | | services.AddJwt<JwtHandler>(enableGlobalAuthorize: true); |
| | | LogHelper.Debug("5"); |
| | | |
| | | //// 拦截器 |
| | | services.AddMvcFilter<AuthorizationFilter>(); |
| | | services.AddMvcFilter<ActionFilter>(); |
| | | services.AddMvcFilter<ResultFilter>(); |
| | | LogHelper.Debug("6"); |
| | | |
| | | //需在 services.AddControllers() 之前注册 |
| | | services.AddCorsAccessor(); |
| | |
| | | }); |
| | | // 添加即时通讯 |
| | | services.AddSignalR(); |
| | | LogHelper.Debug("7"); |
| | | SnowFlakeSingle.WorkId = Yw.Settings.SqlSugarParasHelper.SqlSugar.SnowFlakeWorkId; |
| | | LogHelper.Debug("测试service"); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) |
| | | { |
| | | LogHelper.Debug("0"); |
| | | if (env.IsDevelopment()) |
| | | { |
| | | app.UseDeveloperExceptionPage(); |