feat: 添加生产环境与开发环境配置
This commit is contained in:
1
.env.development
Normal file
1
.env.development
Normal file
@@ -0,0 +1 @@
|
||||
VITE_BASE_URL="http://localhost:8080"
|
||||
1
.env.production
Normal file
1
.env.production
Normal file
@@ -0,0 +1 @@
|
||||
VITE_BASE_URL="http://local.kmux.cn:8080"
|
||||
9
env.d.ts
vendored
Normal file
9
env.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_BASE_URL: string;
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv;
|
||||
}
|
||||
@@ -22,7 +22,7 @@ export const createHttpClient = (
|
||||
resolveSessionId?: SessionResolver,
|
||||
): HttpClient => {
|
||||
const instance = axios.create({
|
||||
baseURL: "http://local.kmux.cn:8080",
|
||||
baseURL: import.meta.env.VITE_BASE_URL,
|
||||
});
|
||||
|
||||
instance.interceptors.request.use((config: InternalAxiosRequestConfig) => {
|
||||
|
||||
Reference in New Issue
Block a user