Add AppSetting Configuration
This commit is contained in:
6
ServiceHost/AppSettingConfiguration.cs
Normal file
6
ServiceHost/AppSettingConfiguration.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace ServiceHost;
|
||||
|
||||
public class AppSettingConfiguration
|
||||
{
|
||||
public string Domain { get; set; }
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
@using AccountManagement.Domain.TicketAccessAccountAgg
|
||||
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@using Microsoft.Extensions.Options
|
||||
@inject _0_Framework.Application.IAuthHelper AuthHelper;
|
||||
@inject ITicketAccessAccountRepository TicketAccessAccount;
|
||||
@inject IOptions<AppSettingConfiguration> AppSetting;
|
||||
@{
|
||||
|
||||
<style>
|
||||
@@ -463,7 +465,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li permission="500">
|
||||
<a href="https://admin.dad-mehr.ir/admin/monthly-overview" class="waves-effect btnWorkFlow" style="display: flex;align-items: center;justify-content: space-between;">
|
||||
<a href="https://admin@(AppSetting.Value.Domain)/admin/monthly-overview" class="waves-effect btnWorkFlow" style="display: flex;align-items: center;justify-content: space-between;">
|
||||
<div class="menuTitle">
|
||||
<i class="md md-home"></i>
|
||||
<span> بررسی امور ماهانه </span>
|
||||
|
||||
@@ -78,6 +78,7 @@ builder.Services.AddTransient<IUidService, UidService>();
|
||||
#region Mahan
|
||||
|
||||
builder.Services.AddTransient<Tester>();
|
||||
builder.Services.Configure<AppSettingConfiguration>(builder.Configuration);
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -96,6 +97,7 @@ builder.Services.Configure<CookiePolicyOptions>(options =>
|
||||
options.CheckConsentNeeded = context => true;
|
||||
//options.MinimumSameSitePolicy = SameSiteMode.Strict;
|
||||
});
|
||||
var domain = builder.Configuration["Domain"];
|
||||
|
||||
builder.Services.ConfigureApplicationCookie(options =>
|
||||
{
|
||||
@@ -103,7 +105,7 @@ builder.Services.ConfigureApplicationCookie(options =>
|
||||
options.Cookie.HttpOnly = true;
|
||||
options.Cookie.SameSite = SameSiteMode.None; // مهم ✅
|
||||
options.Cookie.SecurePolicy = CookieSecurePolicy.Always; // فقط روی HTTPS کار میکنه ✅
|
||||
options.Cookie.Domain = ".dad-mehr.ir"; // دامنه مشترک بین پدر و سابدامینها ✅
|
||||
options.Cookie.Domain = domain; // دامنه مشترک بین پدر و سابدامینها ✅
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,8 @@
|
||||
"SmsSecrets": {
|
||||
"ApiKey": "Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa",
|
||||
"SecretKey": "dadmehr"
|
||||
}
|
||||
},
|
||||
"Domain": ".dad-mehr.ir"
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -25,5 +25,6 @@
|
||||
"faceModels": {
|
||||
"Faces": "c://labels//20//"
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
"AllowedHosts": "*",
|
||||
"Domain": ".gozareshgir.ir"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user