fix: axios header 추가
This commit is contained in:
parent
a49e42687b
commit
1a6968abd1
@ -1,12 +1,13 @@
|
|||||||
import { useSpinnerStore } from '@/store/spinnerStore'
|
import { useSpinnerStore } from '@/store/spinnerStore'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
export const axiosInstance = (url: string | null | undefined) => {
|
export const axiosInstance = (url: string | null | undefined, headers?: Record<string, string>) => {
|
||||||
const baseURL = url || process.env.NEXT_PUBLIC_API_URL
|
const baseURL = url || process.env.NEXT_PUBLIC_API_URL
|
||||||
const instance = axios.create({
|
const instance = axios.create({
|
||||||
baseURL,
|
baseURL,
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
|
...headers,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user