From e7cc81ca8b2c68ef09bffca2cba4f56e099ac6d5 Mon Sep 17 00:00:00 2001 From: cat_shark <1716967236@qq.com> Date: Sat, 2 Aug 2025 10:01:01 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E5=A2=9E=E5=8A=A0=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 1 + .env.production | 1 + package.json | 4 ++-- src/utils/request.ts | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 .env.development create mode 100644 .env.production diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..66db44e --- /dev/null +++ b/.env.development @@ -0,0 +1 @@ +VITE_BASE_URL = 'http://localhost:5157' \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..2835021 --- /dev/null +++ b/.env.production @@ -0,0 +1 @@ +VITE_BASE_URL = 'http://192.168.123.199:5157' \ No newline at end of file diff --git a/package.json b/package.json index 0d5d287..28b5603 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "private": true, "type": "module", "scripts": { - "dev": "vite", - "build": "run-p type-check \"build-only {@}\" --", + "dev": "vite --mode development", + "build": "vite build --mode production", "preview": "vite preview", "build-only": "vite build", "type-check": "vue-tsc --build --force" diff --git a/src/utils/request.ts b/src/utils/request.ts index 1d56b77..856bd9c 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -1,7 +1,7 @@ import axios from 'axios'; import { ElMessage } from "element-plus"; -const basic_url = "http://localhost:5157"; +const basic_url = import.meta.env.VITE_BASE_URL; const axiosInstance = axios.create({ baseURL: basic_url,