// 环境判断:开发、生产 const envType = process.env.NODE_ENV === 'development' ? 'develop' : 'produce'; // console.log(envType); // 获取当前app的版本 const systemInfo = uni.getSystemInfoSync(); // 应用程序版本号 // 条件编译,只在H5渲染 const version_number = systemInfo.appVersion ? systemInfo.appVersion : '0.0.1'; console.log(version_number,'版本号'); const apiUrl = { develop: { // apiBaseUrl:'http://192.168.2.17:8080', // cky // apiBaseUrl:'http://192.168.2.130:8905', // 130 // apiBaseUrl: 'http://192.168.2.51:9321', // 正式 // apiBaseUrl:'http://192.168.2.130:8905', // 130 // apiBaseUrl: 'http://192.168.2.51:9321', // 正式 // apiBaseUrl: 'http://192.168.2.130:8905', apiBaseUrl: 'https://api.app.blindbox.06zk.com', // 正式 // apiBaseUrl:'https://test.blindbox.06zk.com/api', // 101 // apiBaseUrl:'http://192.168.2.71:8080', // 101 wsUrl: 'ws://xxx', // 正式WebSocket连接地址 weChatCode: 'https://auth.wechat.06zk.com', apiVersion:'0.0.1', appVersion:version_number }, produce: { // apiBaseUrl:'http://192.168.2.130:8905', // 130 // apiBaseUrl: 'https://api.app.blindbox.06zk.com', // 正式 // apiBaseUrl:'https://test.blindbox.06zk.com/api', // 101 // apiBaseUrl: 'http://192.168.2.51:9321', // 正式 apiBaseUrl: 'https://api.app.blindbox.06zk.com', // 正式 // apiBaseUrl:'https://test.blindbox.06zk.com/api', // 101 // apiBaseUrl: 'http://192.168.2.51:9321', // 正式 wsUrl: 'ws://xxxx', // 正式WebSocket连接地址 weChatCode: 'https://auth.wechat.06zk.com', apiVersion:'0.0.1', appVersion:version_number // weChatCode: 'https://auth.wechat.miyamama.cn' //正式 } }; const ApiVersion = function() { return apiUrl[envType]['apiVersion'] }; const AppVersion = function() { return apiUrl[envType]['appVersion'] }; const baseUrl = function(nameSpace) { return apiUrl[envType][nameSpace] }; // 其他服务地址配置 const otherServerUrl = { // gameUrl: 'http://web.wgmwdt.com/games' } export { baseUrl, otherServerUrl, ApiVersion, AppVersion };