From ce6ee8413de4fa4582fd06374e76a6e0df23edc6 Mon Sep 17 00:00:00 2001 From: minimaxagent1 Date: Sat, 2 Aug 2025 13:28:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E4=BD=93=E9=AA=8C=E7=89=88?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/nearbystores/index.vue | 30 +++++++++++++++--------------- utils/request.js | 31 ++++++++++++++++--------------- 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/pages/nearbystores/index.vue b/pages/nearbystores/index.vue index 37dd5c8..219ee7c 100644 --- a/pages/nearbystores/index.vue +++ b/pages/nearbystores/index.vue @@ -58,21 +58,21 @@ - - - {{ bottomSection.prayerSection.title }} - - - - - - {{ bottomSection.prayerSection.prayerButton.title }} - - - {{ bottomSection.prayerSection.prayerButton.subtitle }} - - - + + + + + + + + + + + + + + + diff --git a/utils/request.js b/utils/request.js index ceeca7f..7b574c5 100644 --- a/utils/request.js +++ b/utils/request.js @@ -3,29 +3,30 @@ import { getTempToken, shouldUseTempToken } from '@/config/dev.js' // 环境配置 const ENV_CONFIG = { - development: { + develop: { // 开发环境 baseUrl: 'http://192.168.2.7:4501', - loadingText: '努力加载中~', - loadingTime: 800 + loadingText: '开发环境加载中~', }, - production: { + trial: { // 体验版 baseUrl: 'https://testlu.chuangtewl.com/prod-api', - loadingText: '努力加载中~', - loadingTime: 800 + loadingText: '体验版加载中~', + }, + release: { // 正式版 + baseUrl: 'https://testlu.chuangtewl.com/prod-api', + loadingText: '加载中~', } } // 获取当前环境配置 const getCurrentConfig = () => { - // 可以通过环境变量或其他方式判断环境 - const isDev = process.env.NODE_ENV === 'development' || - uni.getSystemInfoSync().platform === 'devtools' - console.log('当前环境判断:', { - NODE_ENV: process.env.NODE_ENV, - platform: uni.getSystemInfoSync().platform, - isDev: isDev - }) - return isDev ? ENV_CONFIG.development : ENV_CONFIG.production + try { + const { envVersion } = wx.getAccountInfoSync().miniProgram + console.log('当前环境:', envVersion) + return ENV_CONFIG[envVersion] || ENV_CONFIG.release // 默认正式环境 + } catch (error) { + console.warn('获取环境失败,默认使用正式环境:', error) + return ENV_CONFIG.release + } } const config = getCurrentConfig()