123456789101112131415161718192021222324252627282930313233343536 |
- //生产
- const PRO_BASE_URL = "https://pro.cloud.boyuantech.net/manage/api/v1/miniScmApp"
- const PRO_IMG_BASE_URL = "https://pro.cloud.boyuantech.net/img"
- //测试
- const TEST_BASE_URL = "https://test.cloud.boyuantech.net/manage/api/v1/miniScmApp"
- const TEST_IMG_BASE_URL = "https://test.cloud.boyuantech.net/img"
- //本地
- const DEV_BASE_URL = "http://localhost:9001/manage/api/v1/miniScmApp"
- const DEV_IMG_BASE_URL = "https://pro.cloud.boyuantech.net/img"
- let BASE_URL
- let IMG_BASE_URL
- const accountInfo = uni.getAccountInfoSync();
- const env = accountInfo.miniProgram.envVersion
- if (env === 'release') {
- BASE_URL = PRO_BASE_URL
- IMG_BASE_URL = PRO_IMG_BASE_URL
- } else {
- // 生产环境
- BASE_URL = PRO_BASE_URL
- IMG_BASE_URL = PRO_IMG_BASE_URL
- // 测试环境
- // BASE_URL = TEST_BASE_URL
- // IMG_BASE_URL = TEST_IMG_BASE_URL
- // 开发环境
- // BASE_URL = DEV_BASE_URL
- // IMG_BASE_URL = DEV_IMG_BASE_URL
- }
- export {
- BASE_URL,
- IMG_BASE_URL
- }
|