Commit 2ddc20aa authored by 熊洋洋's avatar 熊洋洋

fix: fix deploy

parent 7643b1c9
......@@ -9,14 +9,19 @@ export const backendApi = axios.create({
});
(() => {
axios.get((process.env.NEXT_PUBLIC_BACKEND_URL || 'http://localhost:3001') + "/schema/all").then(
if (!sessionStorage.getItem("baseURL")) {
const url = process.env.NEXT_PUBLIC_BACKEND_URL || 'http://localhost:3001'
axios.get((url) + "/schema/all").then(
() => {
set(backendApi.defaults, "baseURL", process.env.NEXT_PUBLIC_BACKEND_URL)
set(backendApi.defaults, "baseURL", url)
sessionStorage.setItem("baseURL", url)
},
err => {
console.log(err);
sessionStorage.setItem("baseURL",'/backend')
}
);
}
})();
export default APi;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment