let env = require('../env.js')

const {PLATFORM} = env

// #ifdef H5
// const url_all = { 'DEV': '/dev-api', 'BUILD': '' }	 // h5配置
const url_all = { 'DEV': 'https://yhdd.dasongyuhe.com', 'BUILD': '' }	 // h5配置
let protocol = window.location.protocol;
if (protocol === "https:") {
    protocol = "wss:";
} else {
    protocol = "ws:";
}
const ws_url_all = { 'DEV': `/dev-api`, 'BUILD': `${protocol}//${window.location.host}` }
// #endif

// #ifndef H5

let url_all,ws_url_all

if (PLATFORM === "enterprises") {
  // 企事业
	 url_all = { 'DEV': 'https://yhdd.dasongyuhe.com', 'BUILD': 'https://yhdd.dasongyuhe.com' }	 // 非h5配置
	 ws_url_all = { 'DEV': 'https://yhdd.dasongyuhe.com', 'BUILD': 'https://yhdd.dasongyuhe.com' }	 // 非h5配置
}else if (PLATFORM === "sanitation") {
	 url_all = { 'DEV': 'http://tq.5000v.com:8025', 'BUILD': 'http://tq.5000v.com:8025' }	 // 非h5配置
	 ws_url_all = { 'DEV': 'http://tq.5000v.com:8025', 'BUILD': 'http://tq.5000v.com:8025' }	 // 非h5配置
}
// #endif

let server_url = process.env.NODE_ENV === 'development' ? url_all['DEV'] : url_all['BUILD']
let ws_server_url = process.env.NODE_ENV === 'development' ? ws_url_all['DEV'] : ws_url_all['BUILD']

export {
    server_url,
    ws_server_url
};
