From 6f9be933391c2877bf41290635a07b9857e0e78c Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Tue, 21 Oct 2025 17:45:54 +0800
Subject: [PATCH] feat: 打包环境调整

---
 src/utils/common/index.js |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/utils/common/index.js b/src/utils/common/index.js
index 1c2bd62..666398d 100644
--- a/src/utils/common/index.js
+++ b/src/utils/common/index.js
@@ -11,7 +11,7 @@
 // 小程序更新检测
 import { useUserStore } from "@/store/index.js"
 import configEnv from "@/config/env.js";
-import process from "node:process"
+import process from "node:process";
 
 export function mpUpdate () {
   const updateManager = uni.getUpdateManager()
@@ -42,11 +42,13 @@
 }
 
 export function getEnvObj() {
-  return configEnv?.[process?.env?.ENV_NAME] || {}
+  const envName = JSON.parse(__APP_ENV__.UNI_CUSTOM_DEFINE)?.ENV_NAME
+  return configEnv[envName] || {}
 }
 export function getWebViewUrl (targetUrl, otherParams) {
   const userStore = useUserStore()
   const url = getEnvObj().VITE_APP_WEBVIEW_URL
+  console.log(getEnvObj(),'getEnvObj()')
   // 1. 处理用户参数
   const userParams = userStore?.userInfo ? JSON.stringify(userStore.userInfo) : '{}'
   // 2. 构建查询参数字符串

--
Gitblit v1.9.3