feat: input virtual add header request api

This commit is contained in:
2026-05-19 15:11:06 +07:00
parent fc3b752b97
commit bbd3f8d252
2 changed files with 9 additions and 12 deletions
-10
View File
@@ -8,16 +8,6 @@ const createClient = (baseURL, withBaseFormat = false) => {
headers: { 'Content-Type': 'application/json', Accept: 'application/json' }
});
client.interceptors.request.use((config) => {
const token = typeof window !== 'undefined' ? localStorage.getItem('token') : null;
if (token) {
config.headers = config.headers ?? {};
config.headers.Authorization = `Bearer ${token}`;
}
return config;
});
if (withBaseFormat) {
client.interceptors.response.use(
(response) =>