|
@@ -105,9 +105,9 @@ namespace TEAMModelOS
|
|
|
//使用Blob配置
|
|
|
//services.AddAzureBlobStorage().AddConnection(Configuration.GetSection("Azure:Blob").Get<AzureBlobOptions>());
|
|
|
//使用AzureServiceBus
|
|
|
-
|
|
|
- //HttpContextAccessor,并用来访问HttpContext。
|
|
|
- services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
|
|
+
|
|
|
+ //HttpContextAccessor,并用来访问HttpContext。(提供組件或非控制器服務存取HttpContext)
|
|
|
+ services.AddHttpContextAccessor();
|
|
|
//services.AddSingleton<IServiceBusReviceService, ServiceBusReviceService>();
|
|
|
//注入CSRedis
|
|
|
var csredis = new CSRedis.CSRedisClient(Configuration.GetSection("Azure:Redis:ConnectionString").Get<string>());
|
|
@@ -129,7 +129,9 @@ namespace TEAMModelOS
|
|
|
{
|
|
|
app.UseDeveloperExceptionPage();
|
|
|
}
|
|
|
- app.UseMiddleware<HttpGlobalExceptionInvoke>();
|
|
|
+ //TODO 目前不使用中間件全局攔截Exception,請在API中,明確處理200成功返回值或錯誤碼,Exception一率返回BadRequert 400,並選擇需要返回釘釘群組回報的API
|
|
|
+ //app.UseMiddleware<HttpGlobalExceptionInvoke>();
|
|
|
+
|
|
|
//以下需要按照順序載入中間件 如果应用调用 UseStaticFiles,请将 UseStaticFiles 置于 UseRouting之前。
|
|
|
app.UseStaticFiles();
|
|
|
//app.UseSpaStaticFiles(); //使用中間件不開
|