Merge pull request #229 from sbwalker/master
further changes for site creation
This commit is contained in:
commit
f908c104b0
|
@ -5,6 +5,7 @@ using System.Linq;
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Oqtane.Shared;
|
using Oqtane.Shared;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
@ -45,7 +46,7 @@ namespace Oqtane.Services
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return await http.PostJsonAsync<Site>(CreateApiUrl(Alias, NavigationManager.Uri, "Site"), Site);
|
return await http.PostJsonAsync<Site>(apiurl + "?alias=" + WebUtility.UrlEncode(Alias.Name), Site);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ using System.Net.Http;
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
@ -53,7 +54,7 @@ namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return await http.PostJsonAsync<User>(CreateApiUrl(Alias, NavigationManager.Uri, "User"), User);
|
return await http.PostJsonAsync<User>(apiurl + "?alias=" + WebUtility.UrlEncode(Alias.Name), User);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,6 +25,13 @@ namespace Oqtane.Repository
|
||||||
|
|
||||||
// get alias based on request context
|
// get alias based on request context
|
||||||
if (accessor.HttpContext != null)
|
if (accessor.HttpContext != null)
|
||||||
|
{
|
||||||
|
// check if an alias is passed as a querystring parameter
|
||||||
|
if (accessor.HttpContext.Request.Query.ContainsKey("alias"))
|
||||||
|
{
|
||||||
|
aliasname = accessor.HttpContext.Request.Query["alias"];
|
||||||
|
}
|
||||||
|
else // get the alias from the request url
|
||||||
{
|
{
|
||||||
aliasname = accessor.HttpContext.Request.Host.Value;
|
aliasname = accessor.HttpContext.Request.Host.Value;
|
||||||
string path = accessor.HttpContext.Request.Path.Value;
|
string path = accessor.HttpContext.Request.Path.Value;
|
||||||
|
@ -38,6 +45,7 @@ namespace Oqtane.Repository
|
||||||
aliasname = aliasname.Substring(0, aliasname.Length - 1);
|
aliasname = aliasname.Substring(0, aliasname.Length - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else // background processes can pass in an alias using the SiteState service
|
else // background processes can pass in an alias using the SiteState service
|
||||||
{
|
{
|
||||||
if (sitestate != null)
|
if (sitestate != null)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user