From 22d9602a25480f96a0e3a4929d490e6123d3e2cf Mon Sep 17 00:00:00 2001 From: yuantao Date: Mon, 19 Jan 2026 13:54:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E5=90=8D=E7=A7=B0=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=EF=BC=8C=E6=94=AF=E6=8C=81=E9=80=9A=E8=BF=87?= =?UTF-8?q?VITE=5FAPPNAME=E5=8A=A8=E6=80=81=E8=AE=BE=E7=BD=AE=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 1 + vite.config.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.env b/.env index 59c14cb..4bf423e 100644 --- a/.env +++ b/.env @@ -1,6 +1,7 @@ VITE_BASE_URL= #接口地址 VITE_ASSETSURL=https://cdn.vrupup.com/s/1598/assets/ #资源地址 VITE_APPID=wx9cb717d8151d8486 #小程序APPID +VITE_APPNAME=template #小程序名称 VITE_UNI_APPID=_UNI_8842336 #UNI-APPID VITE_LIBVERSION=3.0.0 #微信小程序基础库 VITE_WEBHOOK=https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=9a401eb2-065a-4882-82e9-b438bcd1eac4#WEBHOOK地址 \ No newline at end of file diff --git a/vite.config.js b/vite.config.js index 38eab68..edd5c71 100644 --- a/vite.config.js +++ b/vite.config.js @@ -24,6 +24,7 @@ function replaceManifestAppid() { // 获取环境变量,明确指定路径为项目根目录 dotenv.config({ path: resolve(__dirname, '.env') }) const appid = process.env.VITE_APPID + const appName = process.env.VITE_APPNAME const uni_appId = process.env.VITE_UNI_APPID const libVersion = process.env.VITE_LIBVERSION || '3.0.0' @@ -35,6 +36,7 @@ function replaceManifestAppid() { const manifest = JSON.parse(manifestContent) // 替换 manifest.appid = uni_appId + manifest.name = appName if (manifest['mp-weixin']) { manifest['mp-weixin'].appid = appid