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()