diff --git a/0_Framework/Application/AppSettingConfiguration.cs b/0_Framework/Application/AppSettingConfiguration.cs index 414949f1..127f11d5 100644 --- a/0_Framework/Application/AppSettingConfiguration.cs +++ b/0_Framework/Application/AppSettingConfiguration.cs @@ -3,4 +3,6 @@ public class AppSettingConfiguration { public string Domain { get; set; } + public string ClientDomain =>"client"+Domain; + public string AdminDomain =>"admin"+Domain; } \ No newline at end of file diff --git a/ServiceHost/Pages/login/Index.cshtml.cs b/ServiceHost/Pages/login/Index.cshtml.cs index bb550364..61281f79 100644 --- a/ServiceHost/Pages/login/Index.cshtml.cs +++ b/ServiceHost/Pages/login/Index.cshtml.cs @@ -24,6 +24,7 @@ using Microsoft.AspNetCore.Authentication.Cookies; using CompanyManagment.App.Contracts.AndroidApkVersion; using CompanyManagment.EFCore; using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Options; namespace ServiceHost.Pages.login; @@ -35,6 +36,7 @@ public class IndexModel : PageModel private readonly IAndroidApkVersionApplication _androidApkVersionApplication; private readonly CompanyContext _context; private readonly IRollCallDomainService _rollCallDomainService; + private readonly AppSettingConfiguration _appSettingConfiguration; public string Mess { get; set; } [BindProperty] public string Username { get; set; } @@ -47,7 +49,7 @@ public class IndexModel : PageModel public IndexModel(IAccountApplication accountApplication, IGoogleRecaptcha googleRecaptcha, IAuthHelper authHelper, IAndroidApkVersionApplication androidApkVersionApplication, CompanyContext context, - IRollCallDomainService rollCallDomainService) + IRollCallDomainService rollCallDomainService, IOptions optionsAppSetting) { _accountApplication = accountApplication; _googleRecaptcha = googleRecaptcha; @@ -55,6 +57,7 @@ public class IndexModel : PageModel _androidApkVersionApplication = androidApkVersionApplication; _context = context; _rollCallDomainService = rollCallDomainService; + _appSettingConfiguration = optionsAppSetting.Value; } public IActionResult OnGet() @@ -87,7 +90,7 @@ public class IndexModel : PageModel } else { - return Redirect("/Admin"); + return Redirect($"https://{_appSettingConfiguration.AdminDomain}"); } } @@ -167,7 +170,7 @@ public class IndexModel : PageModel switch (result.SendId) { case 1: - return Redirect("/Admin"); + return Redirect($"https://{_appSettingConfiguration.AdminDomain}"); break; case 2: