new_app/commons/config.js

60 lines
1.5 KiB
JavaScript

//打包时修改env的值即可
const env = 'php_production' //test,production,local
export const encryptKey = '1234567890123456' // http数据加解密的key
export const apiUrl = '/czg/app/'
// export const apiUrl = '/api/'
export const h5Config = {
production: 'https://web.hnsiyao.cn',
test: 'https://web-api.hnsiyao.cn',
// local: 'http://192.168.1.21:8100',
local: 'http://192.168.1.43:1333',
zhangsong_local:'http://192.168.1.54:1024',
hong:'http://192.168.1.31:8080',
php_production:'https://ph.hnsiyao.cn',
php_test:'https://playlet.test.sxczgkj.com',
}
export const AppConfig = {
production: 'https://dj-api.hnsiyao.cn',
test: 'https://web-api.hnsiyao.cn',
// local: 'http://192.168.1.21:8100',
local: 'http://192.168.1.43:1333',
zhangsong_local:'http://192.168.1.54:1024',
hong:'http://192.168.1.31:8080',
php_production:'https://ph.hnsiyao.cn',
php_test:'https://playlet.test.sxczgkj.com'
}
export function returnShareUrl() {
if (env === 'test') {
return 'https://video-h5.hnsiyao.cn'
}
if (env === 'production') {
return 'https://dj-h5.hnsiyao.cn'
}
if (env === 'php_production') {
return 'https://ph-h5.hnsiyao.cn'
}
if (env === 'local') {
return AppConfig[env]
}
}
// #ifdef H5
export default {
baseUrl: h5Config[env],
baseApiUrl: h5Config[env] + apiUrl,
shareUrl: returnShareUrl()
}
// #endif
// #ifdef APP
export default {
baseUrl: AppConfig[env],
baseApiUrl: AppConfig[env] + apiUrl,
shareUrl: returnShareUrl()
}
// #endif