From 7ea90f8276433857fb9a786a822b3993ed1a40d1 Mon Sep 17 00:00:00 2001 From: Theo <971366405@qq.com> Date: Tue, 17 Jun 2025 16:42:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20:sparkles:=20=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E6=A0=B9=E6=8D=AE=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=86=85=E5=AE=B9=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 页面标题根据配置文件内容设置 --- .env.development | 3 ++- .env.production | 4 ++-- index.html | 2 +- src/types/env.d.ts | 2 ++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.env.development b/.env.development index 55b854a1..8dbca7fd 100644 --- a/.env.development +++ b/.env.development @@ -1,6 +1,7 @@ # 应用端口 VITE_APP_PORT=3000 - +# 项目名称 +VITE_APP_TITLE=vue3-element-admin # 代理前缀 VITE_APP_BASE_API=/dev-api diff --git a/.env.production b/.env.production index 17729b65..cf3bf9a2 100644 --- a/.env.production +++ b/.env.production @@ -1,6 +1,6 @@ # 代理前缀 VITE_APP_BASE_API = '/prod-api' - - +# 项目名称 +VITE_APP_TITLE=vue3-element-admin # WebSocket端点(可选) #VITE_APP_WS_ENDPOINT=wss://api.youlai.tech/ws diff --git a/index.html b/index.html index 1c086a72..b20eb78e 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@ name="keywords" content="vue,element-plus,typescript,vue-element-admin,vue3-element-admin" /> - vue3-element-admin + %VITE_APP_TITLE% diff --git a/src/types/env.d.ts b/src/types/env.d.ts index 301f03ea..1342f61e 100644 --- a/src/types/env.d.ts +++ b/src/types/env.d.ts @@ -4,6 +4,8 @@ interface ImportMetaEnv { /** 应用端口 */ VITE_APP_PORT: number; + /** 应用名称 */ + VITE_APP_NAME: string; /** API 基础路径(代理前缀) */ VITE_APP_BASE_API: string; /** API 地址 */