chore: Add Axios header config when https protocol use!!
This commit is contained in:
parent
b8972c059e
commit
b1f7d50c32
@ -10,12 +10,14 @@ export function useAxios(lang = '') {
|
||||
let type = AxiosType.INTERNAL
|
||||
url.startsWith('http') ? (type = AxiosType.EXTERNAL) : ''
|
||||
|
||||
let headerValue = {
|
||||
Accept: 'application/json',
|
||||
}
|
||||
url.startsWith('https') ? '' : (headerValue['lang'] = lang)
|
||||
|
||||
return axios.create({
|
||||
baseURL: type === AxiosType.INTERNAL ? process.env.NEXT_PUBLIC_API_SERVER_PATH : '',
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
lang,
|
||||
},
|
||||
headers: headerValue,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user