optimizing tenant resolution and routing

This commit is contained in:
Shaun Walker
2021-05-10 17:45:39 -04:00
parent 15b0bed257
commit a5de639d15
85 changed files with 592 additions and 723 deletions

View File

@ -1,9 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Oqtane.Shared {
namespace Oqtane.Shared {
public class ControllerRoutes {
public const string Default = "{alias}/api/[controller]";
public const string ApiRoute = "api/[controller]";
}
}

View File

@ -1,4 +1,4 @@
using Oqtane.Models;
using Oqtane.Models;
using System;
using System.Collections.Generic;
using System.Globalization;
@ -102,7 +102,7 @@ namespace Oqtane.Shared
public static string ContentUrl(Alias alias, int fileId, bool asAttachment)
{
var aliasUrl = (alias == null) ? "/~" : "/" + alias.AliasId;
var aliasUrl = (alias != null && !string.IsNullOrEmpty(alias.Path)) ? "/" + alias.Path : "";
var method = asAttachment ? "/attach":"";
return $"{aliasUrl}{Constants.ContentUrl}{fileId}{method}";