@
meshell 正解,小程序有自己的变量区别环境
也可以把域名放进配置里做自动化部署
const accountInfo = uni.getAccountInfoSync()
const envVersion = accountInfo.miniProgram.envVersion
import siteConfig from '@/utils/config.js'
let baseUrl = ''
if (envVersion === 'develop') {
baseUrl = siteConfig.devBaseUrl
} else {
baseUrl = siteConfig.prodBaseUrl
}