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