Moves routing into IAreaRoutes, ensures back office is redirected if installed

This commit is contained in:
Shannon
2020-05-13 14:49:00 +10:00
parent 2e51b11f7c
commit 4d6df1405f
17 changed files with 314 additions and 154 deletions

View File

@@ -51,8 +51,10 @@ namespace Umbraco.Web.Common.Install
[TypeFilter(typeof(StatusCodeResultAttribute), Arguments = new object []{System.Net.HttpStatusCode.ServiceUnavailable})]
public async Task<ActionResult> Index()
{
var umbracoPath = Url.GetBackOfficeUrl();
if (_runtime.Level == RuntimeLevel.Run)
return Redirect(_globalSettings.UmbracoPath.EnsureEndsWith('/'));
return Redirect(umbracoPath);
if (_runtime.Level == RuntimeLevel.Upgrade)
{
@@ -69,8 +71,8 @@ namespace Umbraco.Web.Common.Install
}
}
// gen the install base urlAddUmbracoCore
ViewData.SetInstallApiBaseUrl(Url.GetUmbracoApiService("GetSetup", "InstallApi", Umbraco.Core.Constants.Web.Mvc.InstallArea).TrimEnd("GetSetup"));
// gen the install base url
ViewData.SetInstallApiBaseUrl(Url.GetInstallerApiUrl());
// get the base umbraco folder
ViewData.SetUmbracoBaseFolder(_hostingEnvironment.ToAbsolute(_globalSettings.UmbracoPath));