From 78ccddadb87e0d4dd7f74733a031393395db2869 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期三, 29 五月 2024 14:38:39 +0800
Subject: [PATCH] nothing
---
VueWebApi/App_Start/Startup.cs | 39 ++++++++++++++++++++++++++++++++++++---
1 files changed, 36 insertions(+), 3 deletions(-)
diff --git a/VueWebApi/App_Start/Startup.cs b/VueWebApi/App_Start/Startup.cs
index d2fc6c2..6f90119 100644
--- a/VueWebApi/App_Start/Startup.cs
+++ b/VueWebApi/App_Start/Startup.cs
@@ -1,4 +1,6 @@
-锘縰sing Microsoft.Owin;
+锘縰sing Microsoft.AspNet.SignalR;
+using Microsoft.Owin;
+using Microsoft.Owin.Cors;
using Owin;
using System;
using System.Collections.Generic;
@@ -11,8 +13,39 @@
{
public void Configuration(IAppBuilder app)
{
- // 閰嶇疆闆嗙嚎鍣�
- app.MapSignalR();
+ // 鏈夊叧濡備綍閰嶇疆搴旂敤绋嬪簭鐨勮缁嗕俊鎭紝璇疯闂� https://go.microsoft.com/fwlink/?LinkID=316888
+ //鍏佽璺ㄥ煙
+ //app.UseCors(CorsOptions.AllowAll);
+ //app.MapSignalR("Hubs/chatHub", new HubConfiguration());
+ //app.MapSignalR();
+ //鑷繁璁惧畾璁块棶璺緞锛屽悓鏃惰缃瓾ub閰嶇疆椤癸紝鏃犻渶鎸囧畾鍚姩鐨凥ub绫伙紝鍥犱负瀹冧滑琚嚜鍔ㄨ瘑鍒�
+
+ // 杩炴帴鏍囪瘑
+ //app.Map("/signalr", map =>
+ //{
+ // //璺ㄥ煙
+ // map.UseCors(CorsOptions.AllowAll);
+ // var hubConfiguration = new HubConfiguration
+ // {
+ // EnableJSONP = true
+ // };
+ // //鍚姩閰嶇疆
+ // map.RunSignalR(hubConfiguration);
+ //});
+
+
+ // 杩炴帴鏍囪瘑
+ app.Map("/signalr", map =>
+ {
+ //璺ㄥ煙
+ map.UseCors(CorsOptions.AllowAll);
+ var hubConfiguration = new HubConfiguration
+ {
+ EnableJSONP = true
+ };
+ //鍚姩閰嶇疆
+ map.RunSignalR(hubConfiguration);
+ });
}
}
}
\ No newline at end of file
--
Gitblit v1.9.3