添加环境变量
Some checks failed
CI / build (push) Failing after 28s

This commit is contained in:
Jeffrey Hsu 2024-10-05 21:05:56 +08:00
parent 00279abafc
commit 8b454eced8
3 changed files with 3 additions and 1 deletions

1
.env.development Normal file
View File

@ -0,0 +1 @@
VITE_BASE_URL = "/api"

1
.env.production Normal file
View File

@ -0,0 +1 @@
VITE_BASE_URL = "/"

View File

@ -2,7 +2,7 @@ import axios, {AxiosError, AxiosRequestConfig} from 'axios'
export async function request<T = unknown>(config: AxiosRequestConfig<any>): Promise<T> {
const instance = axios.create({
baseURL: "/api",
baseURL: import.meta.env.VITE_BASE_URL,
timeout: 5000,
headers: {},
})