mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 00:39:49 +00:00
temporary solution
This commit is contained in:
parent
3fdd100107
commit
d865af072b
@ -1,5 +1,5 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import auth from '../../utils/auth';
|
import auth from '../auth';
|
||||||
|
|
||||||
export const reqInterceptor = async (config) => {
|
export const reqInterceptor = async (config) => {
|
||||||
config.headers = {
|
config.headers = {
|
||||||
@ -44,4 +44,4 @@ export const fetchClient = ({ baseURL }) => {
|
|||||||
return instance;
|
return instance;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default fetchClient({ baseURL: process.env.STRAPI_ADMIN_BACKEND_URL });
|
export default fetchClient;
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
import instance from '../fetchClient';
|
import fetchClient from '../fetchClient';
|
||||||
|
|
||||||
function getFetchClient(defaultOptions = {}) {
|
const getFetchClient = (defaultOptions = {}) => {
|
||||||
|
const instance = fetchClient({ baseURL: window.strapi.backendURL });
|
||||||
return {
|
return {
|
||||||
get: (url, config) => instance.get(url, { ...defaultOptions, ...config }),
|
get: (url, config) => instance.get(url, { ...defaultOptions, ...config }),
|
||||||
put: (url, data, config) => instance.put(url, data, { ...defaultOptions, ...config }),
|
put: (url, data, config) => instance.put(url, data, { ...defaultOptions, ...config }),
|
||||||
post: (url, data, config) => instance.post(url, data, { ...defaultOptions, ...config }),
|
post: (url, data, config) => instance.post(url, data, { ...defaultOptions, ...config }),
|
||||||
del: (url, config) => instance.delete(url, { ...defaultOptions, ...config }),
|
del: (url, config) => instance.delete(url, { ...defaultOptions, ...config }),
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
export default getFetchClient;
|
export default getFetchClient;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user