diff --git a/packages/core/client/src/api-client/APIClient.ts b/packages/core/client/src/api-client/APIClient.ts index 78ba5bbc6f..3b358e0073 100644 --- a/packages/core/client/src/api-client/APIClient.ts +++ b/packages/core/client/src/api-client/APIClient.ts @@ -7,7 +7,7 @@ * For more information, please refer to: https://www.nocobase.com/agreement. */ -import { APIClient as APIClientSDK, getSubAppName } from '@nocobase/sdk'; +import { APIClient as APIClientSDK } from '@nocobase/sdk'; import { Result } from 'ahooks/es/useRequest/src/types'; import { notification } from 'antd'; import React from 'react'; @@ -91,10 +91,10 @@ export class APIClient extends APIClientSDK { interceptors() { this.axios.interceptors.request.use((config) => { config.headers['X-With-ACL-Meta'] = true; - const appName = this.app ? getSubAppName(this.app.getPublicPath()) : null; - if (appName) { - config.headers['X-App'] = appName; - } + const headers = this.getHeaders(); + Object.keys(headers).forEach((key) => { + config.headers[key] = headers[key]; + }); return config; }); super.interceptors();