Hi,
I want to remove tenant from header request after I navigate to other page as click just Documents Menu Item. How can I do this?
Thanks
Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.
If you're creating a bug/problem report, please include followings:
- ABP Framework version: v5.3.3
- UI type: MVC
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): yes
- Exception message and stack trace:
- Steps to reproduce the issue:"
4 Answer(s)
-
0
Hi,
Do you want to switch to
host
when navigating the document page, right? -
0
Hi,
Do you want to switch to
host
when navigating the document page, right?Yes, I want to use host db when navigate to documents page even I login with tenant user
-
0
Hi,
You can check this: https://docs.abp.io/en/abp/latest/Multi-Tenancy#custom-tenant-resolvers
Pseudo code:
public class DocumentTenantResolverContributor : HttpTenantResolveContributorBase { public override string Name { get; } protected override Task<string> GetTenantIdOrNameFromHttpContextOrNullAsync(ITenantResolveContext context, HttpContext httpContext) { if(httpContext.Request.GetDisplayUrl().Contains("/...")) { context.Handled = true; } return Task.FromResult<string>(null); } } Configure<AbpTenantResolveOptions>(options => { options.TenantResolvers.Insert(0, .); });
The
TenantResolverContributor
needs add to as the first contributor -
0
it works, thanks