Commit 7643b1c9 authored by 熊洋洋's avatar 熊洋洋

fix: fix deploy

parent d2b7ef58
"use client"
'use client';
import { set } from 'lodash';
import axios from 'redaxios';
const APi = axios.create({
});
const APi = axios.create({});
export const backendApi = axios.create({
"baseURL": globalThis?.location?.protocol === 'https:' ? '/backend' : (process.env.NEXT_PUBLIC_BACKEND_URL || "http://localhost:3001")
baseURL: '/backend',
});
(() => {
axios.get((process.env.NEXT_PUBLIC_BACKEND_URL || 'http://localhost:3001') + "/schema/all").then(
() => {
set(backendApi.defaults, "baseURL", process.env.NEXT_PUBLIC_BACKEND_URL)
},
err => {
console.log(err);
}
);
})();
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