Skip to content

Commit

Permalink
fix: export named error for tenant component (#3840)
Browse files Browse the repository at this point in the history
* fix: export named error

* docs: update
  • Loading branch information
czy88840616 committed May 9, 2024
1 parent 9b13409 commit f746d64
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/tenant/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { TenantConfiguration } from './configuration';
export { TenantConfiguration as Configuration } from './configuration';
export * from './tenantManager';
4 changes: 2 additions & 2 deletions site/docs/extensions/tenant.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class TenantMiddleware {
resolve() {
return async(ctx, next) => {
// 请求链路中设置租户信息
this.tenantManager.setCurrentTenant({
await this.tenantManager.setCurrentTenant({
id: '123',
name: '我的租户'
});
Expand All @@ -125,7 +125,7 @@ class TenantService {
const tenantInfo = await this.tenantManager.getCurrentTenant<TenantInfo>();
if (tenantInfo) {
console.log(tenantInfo.name);
// output => 我的租户
// output => 我的租户
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class TenantMiddleware {
resolve() {
return async(ctx, next) => {
//Set tenant information in the request link
this.tenantManager.setCurrentTenant({
await this.tenantManager.setCurrentTenant({
id: '123',
name: 'my tenant'
});
Expand All @@ -125,7 +125,7 @@ class TenantService {
const tenantInfo = await this.tenantManager.getCurrentTenant<TenantInfo>();
if (tenantInfo) {
console.log(tenantInfo.name);
// output => my tenant
// output => my tenant
}
}
}
Expand All @@ -139,4 +139,4 @@ class TenantService {
* 2. The tenant information saved in each request is isolated
* 3. Regardless of whether it is a singleton or a request scope, you can only obtain the tenant data corresponding to the current request.

:::
:::

0 comments on commit f746d64

Please sign in to comment.