调整:环境变量URL
This commit is contained in:
3
.env
3
.env
@@ -1,3 +1,6 @@
|
|||||||
|
# 项目后端API地址
|
||||||
|
VITE_PROJECT_API=
|
||||||
|
|
||||||
# 百度统计相关配置
|
# 百度统计相关配置
|
||||||
VITE_BAIDU_TONGJI_KEY=
|
VITE_BAIDU_TONGJI_KEY=
|
||||||
VITE_BAIDU_TONGJI_SECRET_KEY=
|
VITE_BAIDU_TONGJI_SECRET_KEY=
|
||||||
|
|||||||
2
src/types/env.d.ts
vendored
2
src/types/env.d.ts
vendored
@@ -1,4 +1,6 @@
|
|||||||
interface ImportMetaEnv {
|
interface ImportMetaEnv {
|
||||||
|
readonly VITE_PROJECT_API: string;
|
||||||
|
|
||||||
readonly VITE_BAIDU_TONGJI_KEY: string;
|
readonly VITE_BAIDU_TONGJI_KEY: string;
|
||||||
readonly VITE_BAIDU_TONGJI_SECRET_KEY: string;
|
readonly VITE_BAIDU_TONGJI_SECRET_KEY: string;
|
||||||
readonly VITE_BAIDU_TONGJI_SITE_ID: string;
|
readonly VITE_BAIDU_TONGJI_SITE_ID: string;
|
||||||
|
|||||||
@@ -3,9 +3,8 @@ import { Modal, notification } from "antd";
|
|||||||
import { useUserStore } from "@/stores";
|
import { useUserStore } from "@/stores";
|
||||||
|
|
||||||
// 配置项目API域名
|
// 配置项目API域名
|
||||||
// export const baseURL = "http://localhost:9003/api";
|
// 最新调整:在本地 .env 文件配置你的后端API地址
|
||||||
export const baseURL = "https://api.liuyuyang.net/api";
|
export const baseURL = import.meta.env.VITE_PROJECT_API;
|
||||||
// export const baseURL = "http://api.thrive.liuyuyang.net/api";
|
|
||||||
|
|
||||||
// 创建 axios 实例
|
// 创建 axios 实例
|
||||||
export const instance = axios.create({
|
export const instance = axios.create({
|
||||||
|
|||||||
Reference in New Issue
Block a user