1
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import Taro from '@tarojs/taro'
|
import Taro from '@tarojs/taro'
|
||||||
|
|
||||||
// 环境类型
|
// 环境类型
|
||||||
export type EnvType = 'development' | 'test' | 'production'
|
export type EnvType = 'development' | 'production'
|
||||||
|
|
||||||
// 环境配置接口
|
// 环境配置接口
|
||||||
export interface EnvConfig {
|
export interface EnvConfig {
|
||||||
@@ -17,22 +17,14 @@ const envConfigs: Record<EnvType, EnvConfig> = {
|
|||||||
// 开发环境
|
// 开发环境
|
||||||
development: {
|
development: {
|
||||||
name: '开发环境',
|
name: '开发环境',
|
||||||
// apiBaseURL: 'https://sit.light120.com',
|
apiBaseURL: 'https://sit.light120.com',
|
||||||
apiBaseURL: 'http://localhost:9098',
|
// apiBaseURL: 'http://localhost:9098',
|
||||||
timeout: 15000,
|
timeout: 15000,
|
||||||
enableLog: true,
|
enableLog: true,
|
||||||
enableMock: true
|
enableMock: true
|
||||||
},
|
},
|
||||||
|
|
||||||
// 测试环境
|
|
||||||
test: {
|
|
||||||
name: '测试环境',
|
|
||||||
apiBaseURL: 'https://sit.light120.com',
|
|
||||||
// apiBaseURL: 'http://localhost:9098',
|
|
||||||
timeout: 12000,
|
|
||||||
enableLog: true,
|
|
||||||
enableMock: false
|
|
||||||
},
|
|
||||||
|
|
||||||
// 生产环境
|
// 生产环境
|
||||||
production: {
|
production: {
|
||||||
@@ -85,10 +77,7 @@ export const isProduction = (): boolean => {
|
|||||||
return getCurrentEnv() === 'production'
|
return getCurrentEnv() === 'production'
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否为测试环境
|
|
||||||
export const isTest = (): boolean => {
|
|
||||||
return getCurrentEnv() === 'test'
|
|
||||||
}
|
|
||||||
|
|
||||||
// 环境配置调试信息
|
// 环境配置调试信息
|
||||||
export const getEnvInfo = () => {
|
export const getEnvInfo = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user