set client dashboard

This commit is contained in:
2025-10-01 14:02:19 +03:30
parent d0928804ee
commit 0e3e783c5c
2 changed files with 8 additions and 3 deletions

View File

@@ -3,4 +3,6 @@
public class AppSettingConfiguration
{
public string Domain { get; set; }
public string ClientDomain =>"client"+Domain;
public string AdminDomain =>"admin"+Domain;
}

View File

@@ -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<AppSettingConfiguration> 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: