Commit abd60335 by 张立顺

修改环境取值位置

1 parent 4e8eda3e
...@@ -4,14 +4,19 @@ ...@@ -4,14 +4,19 @@
*/ */
// 配置预发布的小程序aapId // 配置预发布的小程序aapId
export const preReleaseAppId = 'wx24ebae5768e74138' // export const preReleaseAppId = 'wx24ebae5768e74138'
// 小程序id // 小程序id
export const appId = 'wx570d9331f9ace0bd' export const appId = 'wx570d9331f9ace0bd'
// 开发环境 /**
* 环境指定
// 开发指定的小程序 * 0本地
* 1开发
* 2测试
* 3生产环境
*/
export const env = 1
// sentry Dsn 地址 // sentry Dsn 地址
export const dsnUrl = 'https://ddaadc52bf8d4ecc92eca632683d456a@sentry.glsx.com.cn/23' export const dsnUrl = 'https://ddaadc52bf8d4ecc92eca632683d456a@sentry.glsx.com.cn/23'
/** import { env } from '~/config'
*
0本地
1开发
2测试
3生产环境
*/
const accountInfo = wx.getAccountInfoSync() const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync() const systemInfo = wx.getSystemInfoSync()
// console.log(systemInfo); // console.log(systemInfo);
// console.log(accountInfo.miniProgram.envVersion) // console.log(accountInfo.miniProgram.envVersion)
//手动控制体验版环境的请求 true就依据下面index false就默认为2 //手动控制体验版环境的请求 true就依据下面index false就默认为2
const manual = false const manual = false
const release = false const release = false
let index = 2 const index = env
// 判断小程序环境 // 判断小程序环境
// develop:开发版(正常开发工具,测试时) // develop:开发版(正常开发工具,测试时)
...@@ -25,7 +19,6 @@ let index = 2 ...@@ -25,7 +19,6 @@ let index = 2
if (systemInfo.platform != 'devtools') { if (systemInfo.platform != 'devtools') {
switch (accountInfo.miniProgram.envVersion) { switch (accountInfo.miniProgram.envVersion) {
case 'develop': case 'develop':
// this.globalData.url = 'http://192.168.0.252:3000/api'; //
break break
case 'trial': case 'trial':
index = manual ? index : 2 index = manual ? index : 2
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!