mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-22 11:01:22 +03:00
26 lines
590 B
JavaScript
26 lines
590 B
JavaScript
import axios from 'axios'
|
|
import { baseURL } from 'store/constant'
|
|
|
|
const apiClient = axios.create({
|
|
baseURL: `${baseURL}/api/v1`,
|
|
headers: {
|
|
'Content-type': 'application/json'
|
|
}
|
|
})
|
|
|
|
apiClient.interceptors.request.use(function (config) {
|
|
const username = localStorage.getItem('username')
|
|
const password = localStorage.getItem('password')
|
|
|
|
if (username && password) {
|
|
config.auth = {
|
|
username: username.toLocaleLowerCase(),
|
|
password: password.toLocaleLowerCase()
|
|
}
|
|
}
|
|
|
|
return config
|
|
})
|
|
|
|
export default apiClient
|