Merge branch 'main' into next

This commit is contained in:
nocobase[bot] 2024-12-05 07:18:12 +00:00
commit af60ae9f73

View File

@ -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();