update
This commit is contained in:
parent
999d55693e
commit
5840cc2cda
|
|
@ -6,7 +6,7 @@ const axiosBaseInstance = axios.create({
|
||||||
baseURL,
|
baseURL,
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"X-Client-Key": "bb65b1ad-e954-4a1a-b4d0-74df5bb0b640"
|
"X-Client-Key": "433489ff-444e-4505-b3df-7504668cb1a9",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ const axiosInterceptorInstance = axios.create({
|
||||||
baseURL,
|
baseURL,
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"X-Client-Key": "bb65b1ad-e954-4a1a-b4d0-74df5bb0b640"
|
"X-Client-Key": "433489ff-444e-4505-b3df-7504668cb1a9",
|
||||||
},
|
},
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@ import axiosBaseInstance from "./axios-base-instance";
|
||||||
|
|
||||||
const defaultHeaders = {
|
const defaultHeaders = {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"X-Client-Key": "bb65b1ad-e954-4a1a-b4d0-74df5bb0b640"
|
"X-Client-Key": "433489ff-444e-4505-b3df-7504668cb1a9",
|
||||||
};
|
};
|
||||||
|
|
||||||
export async function httpGet(pathUrl: any, headers?: any) {
|
export async function httpGet(pathUrl: any, headers?: any) {
|
||||||
console.log("X-HEADERS : ", defaultHeaders)
|
console.log("X-HEADERS : ", defaultHeaders);
|
||||||
const mergedHeaders = {
|
const mergedHeaders = {
|
||||||
...defaultHeaders,
|
...defaultHeaders,
|
||||||
...headers,
|
...headers,
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,11 @@ import { getCsrfToken } from "../master-user";
|
||||||
|
|
||||||
const defaultHeaders = {
|
const defaultHeaders = {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"X-Client-Key": "bb65b1ad-e954-4a1a-b4d0-74df5bb0b640"
|
"X-Client-Key": "433489ff-444e-4505-b3df-7504668cb1a9",
|
||||||
};
|
};
|
||||||
|
|
||||||
export async function httpGetInterceptor(pathUrl: any) {
|
export async function httpGetInterceptor(pathUrl: any) {
|
||||||
console.log("X-HEADERS : ", defaultHeaders)
|
console.log("X-HEADERS : ", defaultHeaders);
|
||||||
const response = await axiosInterceptorInstance
|
const response = await axiosInterceptorInstance
|
||||||
.get(pathUrl, { headers: defaultHeaders })
|
.get(pathUrl, { headers: defaultHeaders })
|
||||||
.catch((error) => error.response);
|
.catch((error) => error.response);
|
||||||
|
|
@ -35,7 +35,11 @@ export async function httpGetInterceptor(pathUrl: any) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function httpPostInterceptor(pathUrl: any, data: any, headers?: any) {
|
export async function httpPostInterceptor(
|
||||||
|
pathUrl: any,
|
||||||
|
data: any,
|
||||||
|
headers?: any
|
||||||
|
) {
|
||||||
const resCsrf = await getCsrfToken();
|
const resCsrf = await getCsrfToken();
|
||||||
const csrfToken = resCsrf?.data?.csrf_token;
|
const csrfToken = resCsrf?.data?.csrf_token;
|
||||||
|
|
||||||
|
|
@ -67,7 +71,11 @@ export async function httpPostInterceptor(pathUrl: any, data: any, headers?: any
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function httpPutInterceptor(pathUrl: any, data: any, headers?: any) {
|
export async function httpPutInterceptor(
|
||||||
|
pathUrl: any,
|
||||||
|
data: any,
|
||||||
|
headers?: any
|
||||||
|
) {
|
||||||
const resCsrf = await getCsrfToken();
|
const resCsrf = await getCsrfToken();
|
||||||
const csrfToken = resCsrf?.data?.csrf_token;
|
const csrfToken = resCsrf?.data?.csrf_token;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue