Shuxia Ning
2025-01-15 9eb94e9eec2e2e164698e34d0481d66093c8655b
WebApi/HStation.WebApi.Xhs.Core/Startup.cs
@@ -11,6 +11,7 @@
using Microsoft.Extensions.Hosting;
using SqlSugar;
using System.Text.Json.Serialization;
using Yw;
using Yw.Application;
namespace HStation.WebApi
@@ -26,23 +27,30 @@
        /// </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();
@@ -77,7 +85,9 @@
            });
            // 添加即时通讯
            services.AddSignalR();
            LogHelper.Debug("7");
            SnowFlakeSingle.WorkId = Yw.Settings.SqlSugarParasHelper.SqlSugar.SnowFlakeWorkId;
            LogHelper.Debug("测试service");
        }
        /// <summary>
@@ -85,6 +95,7 @@
        /// </summary>
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            LogHelper.Debug("0");
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();