const isOnline = function() {
    return process.env.NODE_ENV !== 'development';
}
export default function() {
    //CRM API
    let domainUrl = "";
    // domainUrl = "http://192.168.10.46:8500";
    // domainUrl = "http://192.168.10.128:5003";
    domainUrl = "http://192.168.10.9:8098";
    // domainUrl = "http://crm.oytour.com"
    //domainUrl = "http://localhost:5003";
    let locationName = window.location.hostname;
    //旅游ERPApi
    let domainPostUrl = ""
    domainPostUrl = "http://192.168.10.9:8083";
    //domainPostUrl = "http://192.168.10.46";
    if (isOnline()) {
        if (window.location.host.indexOf('fcrmyx.oytour.com') != -1) {
            domainUrl = "http://crm.oytour.com"
            domainPostUrl = "http://reborn.oytour.com"
        } else {
            domainUrl = "http://testcrm.oytour.com"
            domainPostUrl = "http://testapi.oytour.com"
        }
    }
    var obj = {
        //主地址
        DomainUrl: domainUrl,
        DownLoadContractUrl: domainPostUrl,
        //阿里服务器地址
        AliUrl: "https://reborndev.oss-cn-hangzhou.aliyuncs.com",
        //CRMApi地址 
        PostUrl: domainUrl,
        //旅游ERPApi地址
        ERPApiUrl: domainPostUrl + "/api/common/post",
        ERPApiUrlFile: domainPostUrl + "/api/file/GetFileFromWebApi",
        javaUrl: locationName.indexOf('testb2b') == -1 ? "http://efficient.oytour.com" : locationName.indexOf('testb2b.oytour.com') !== -1 ? "http://47.96.12.235:9001" : "http://192.168.10.215:9000",
        ViittoFileUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('testb2b.oytour.com') !== -1 ? "http://staticfile.oytour.com" : 'http://192.168.10.214:8130',
        UploadUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('testb2b.oytour.com') !== -1 ? "http://uploadfile.oytour.com" : "http://192.168.10.214:8120",
        erpRoutingUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('testb2b.oytour.com') !== -1 ? "http://yx.oytour.com/#/" : "http://localhost:8081/#/"// "http://www.test.com:8081/#/",
    };
    return obj;
}