From 0764437f3fc4d7dff2bef913bf0e3af478e2179d Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 5 May 2019 15:35:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(#IW622):=20=E6=94=AF=E6=8C=81=E4=BA=8C?= =?UTF-8?q?=E7=BA=A7=E5=9F=9F=E5=90=8D=E5=8D=95=E7=82=B9=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #Comment comment #IW622 #Issue close https://gitee.com/LongbowEnterprise/dashboard/issues?id=IW622 --- Bootstrap.Admin/Startup.cs | 6 +++++- Bootstrap.Admin/appsettings.Development.json | 1 + Bootstrap.Admin/appsettings.json | 1 + Bootstrap.Client/Startup.cs | 1 + Bootstrap.Client/appsettings.Development.json | 3 ++- Bootstrap.Client/appsettings.json | 1 + 6 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Bootstrap.Admin/Startup.cs b/Bootstrap.Admin/Startup.cs index c95dd5ba..2ee0d6bf 100644 --- a/Bootstrap.Admin/Startup.cs +++ b/Bootstrap.Admin/Startup.cs @@ -80,7 +80,11 @@ namespace Bootstrap.Admin options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss"; JsonConvert.DefaultSettings = () => options.SerializerSettings; }).SetCompatibilityVersion(CompatibilityVersion.Version_2_2); - services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(options => options.Cookie.Path = "/"); + services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(options => + { + options.Cookie.Path = "/"; + options.Cookie.Domain = Configuration["Domain"]; + }); services.AddApiVersioning(option => { option.DefaultApiVersion = new ApiVersion(1, 0); diff --git a/Bootstrap.Admin/appsettings.Development.json b/Bootstrap.Admin/appsettings.Development.json index f3add900..202ab083 100644 --- a/Bootstrap.Admin/appsettings.Development.json +++ b/Bootstrap.Admin/appsettings.Development.json @@ -17,6 +17,7 @@ }, "SwaggerPathBase": "", "AllowOrigins": "http://localhost:49185", + "Domain": null, "KeyPath": "..\\keys", "DisableAutomaticKeyGeneration": false, "LongbowCache": { diff --git a/Bootstrap.Admin/appsettings.json b/Bootstrap.Admin/appsettings.json index d23cca70..cb71eb2f 100644 --- a/Bootstrap.Admin/appsettings.json +++ b/Bootstrap.Admin/appsettings.json @@ -51,6 +51,7 @@ ], "SwaggerPathBase": "/BA", "AllowOrigins": "http://localhost,http://argo.zylweb.cn", + "Domain": null, "KeyPath": "..\\keys", "ApplicationName": "__bd__", "ApplicationDiscriminator": "BootstrapAdmin", diff --git a/Bootstrap.Client/Startup.cs b/Bootstrap.Client/Startup.cs index c304491d..99734319 100644 --- a/Bootstrap.Client/Startup.cs +++ b/Bootstrap.Client/Startup.cs @@ -60,6 +60,7 @@ namespace Bootstrap.Client services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(options => { options.Cookie.Path = "/"; + options.Cookie.Domain = Configuration["Domain"]; options.RebuildRedirectUri(Configuration["AuthHost"]); }); } diff --git a/Bootstrap.Client/appsettings.Development.json b/Bootstrap.Client/appsettings.Development.json index 1ea4fc1f..a55f84de 100644 --- a/Bootstrap.Client/appsettings.Development.json +++ b/Bootstrap.Client/appsettings.Development.json @@ -32,5 +32,6 @@ ], "KeyPath": "..\\keys", "AuthHost": "http://localhost:50852", - "AllowOrigins": "http://localhost:50852" + "AllowOrigins": "http://localhost:50852", + "Domain": null } diff --git a/Bootstrap.Client/appsettings.json b/Bootstrap.Client/appsettings.json index de1e128b..6c18a691 100644 --- a/Bootstrap.Client/appsettings.json +++ b/Bootstrap.Client/appsettings.json @@ -30,6 +30,7 @@ ], "AppId": 2, "AuthHost": "http://argo.zylweb.cn/BA", + "Domain": null, "AllowOrigins": "http://localhost,http://argo.zylweb.cn", "KeyPath": "..\\keys", "ApplicationName": "__bd__",