change baseurl
This commit is contained in:
parent
4b873306e3
commit
72ced4be3e
|
@ -1,25 +1,25 @@
|
|||
import axios from "axios";
|
||||
|
||||
export const axiosConfigWithoutToken = axios.create({
|
||||
baseURL: "https://localhost:7087/api",
|
||||
});
|
||||
|
||||
const axiosConfig = axios.create({
|
||||
baseURL: "https://localhost:7087/api",
|
||||
});
|
||||
axiosConfig.defaults.params = {};
|
||||
axiosConfig.interceptors.request.use(
|
||||
(config) => {
|
||||
const tokenString = localStorage.getItem("token");
|
||||
const token = tokenString !== null ? JSON.parse(tokenString) : "";
|
||||
if (token) {
|
||||
config.params["authToken"] = token;
|
||||
}
|
||||
return config;
|
||||
},
|
||||
(error) => {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
export default axiosConfig;
|
||||
import axios from "axios";
|
||||
|
||||
export const axiosConfigWithoutToken = axios.create({
|
||||
baseURL: "https://monitor.innov.energy:5000/api",
|
||||
});
|
||||
|
||||
const axiosConfig = axios.create({
|
||||
baseURL: "https://monitor.innov.energy:5000/api",
|
||||
});
|
||||
axiosConfig.defaults.params = {};
|
||||
axiosConfig.interceptors.request.use(
|
||||
(config) => {
|
||||
const tokenString = localStorage.getItem("token");
|
||||
const token = tokenString !== null ? JSON.parse(tokenString) : "";
|
||||
if (token) {
|
||||
config.params["authToken"] = token;
|
||||
}
|
||||
return config;
|
||||
},
|
||||
(error) => {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
export default axiosConfig;
|
||||
|
|
Loading…
Reference in New Issue