mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-07 22:49:26 +08:00
Merge branch 'main' into next
This commit is contained in:
commit
af60ae9f73
@ -7,7 +7,7 @@
|
|||||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
* 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 { Result } from 'ahooks/es/useRequest/src/types';
|
||||||
import { notification } from 'antd';
|
import { notification } from 'antd';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
@ -91,10 +91,10 @@ export class APIClient extends APIClientSDK {
|
|||||||
interceptors() {
|
interceptors() {
|
||||||
this.axios.interceptors.request.use((config) => {
|
this.axios.interceptors.request.use((config) => {
|
||||||
config.headers['X-With-ACL-Meta'] = true;
|
config.headers['X-With-ACL-Meta'] = true;
|
||||||
const appName = this.app ? getSubAppName(this.app.getPublicPath()) : null;
|
const headers = this.getHeaders();
|
||||||
if (appName) {
|
Object.keys(headers).forEach((key) => {
|
||||||
config.headers['X-App'] = appName;
|
config.headers[key] = headers[key];
|
||||||
}
|
});
|
||||||
return config;
|
return config;
|
||||||
});
|
});
|
||||||
super.interceptors();
|
super.interceptors();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user