多租户示例更新

This commit is contained in:
administrator committed 2024-07-04 07:19:34 +08:00
1 parent 9a37f4b67f
commit dbabaaadba
3 files changed
+5 -7

No files matched your search

@@ -10,6 +10,11 @@ namespace MultiTenancySample.ServiceDefaults
const string tenantKey = "tenant";
if(httpContext.User.FindAll(tenantKey).Any())
{
return httpContext.User.FindFirst(tenantKey)?.Value;
}
if (httpContext.Request.Headers.TryGetValue(tenantKey, out var headerValues))
{
return headerValues.First();