芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/rentandbuyrealty.com/rentandbuyrealty.com/web/src/api/AxiosInterceptors.jsx
import axios from 'axios' import { store } from 'src/store/store' const Api = axios.create({ baseURL: `${process.env.NEXT_PUBLIC_API_URL}${process.env.NEXT_PUBLIC_END_POINT}` }) Api.interceptors.request.use(function (config) { let token = undefined if (typeof window !== 'undefined') { token = store.getState()?.user?.data?.token } if (token) config.headers.authorization = `Bearer ${token}` return config }) export default Api