const isOnline = function () {
    return process.env.NODE_ENV !== 'development';
}
export default function () {
    //CRM API
    let domainUrl = "";
    // domainUrl = "http://192.168.5.46:5003";
    domainUrl = "http://192.168.5.56:8032";
    //旅游ERPApi
    let erpApiUrl = ""
    // erpApiUrl = "http://192.168.5.46"
    erpApiUrl = "http://192.168.5.56"
    let erpSiteUrl = "";//ERP前端域名
    let javaUrl="http://192.168.10.215:9000";//javaapi域名获取优惠卷
    let ViittoFileUrl="http://192.168.5.214:8130";//文件预览站点
    let UploadUrl="http://192.168.5.214:8120";//文件上传站点
    
    if (isOnline()) {
        domainUrl = "http://crm.oytour.com";
        erpApiUrl = "http://reborn.oytour.com";
        javaUrl="http://efficient.oytour.com";
        ViittoFileUrl="http://imgfile.oytour.com";
        UploadUrl="http://uploadfile.oytour.com";
    }
    var storageUser = this.getLocalStorage();
    if (isOnline()) {
        erpSiteUrl = "http://admin.oytour.com/#/";
        if (storageUser && storageUser.ERPUrl) {
            erpSiteUrl = storageUser.ERPUrl + "/#/";
        }
    } else {
        erpSiteUrl = "http://localhost:8080/#/";
        if (storageUser && storageUser.ERPUrl) {
            erpSiteUrl = storageUser.ERPUrl + "/#/";
        }
    }

    var obj = {
        DownLoadContractUrl: erpApiUrl,
        //阿里服务器地址
        AliUrl: "https://reborndev.oss-cn-hangzhou.aliyuncs.com",
        //CRMApi地址 
        PostUrl: domainUrl,
        //旅游ERPApi地址
        ERPApiUrl: erpApiUrl + "/api/common/post",
        ERPApiUrlFile: erpApiUrl + "/api/file/GetFileFromWebApi",
        javaUrl: javaUrl,
        ViittoFileUrl: ViittoFileUrl,
        UploadUrl: UploadUrl,
        erpRoutingUrl: erpSiteUrl
    };
    return obj;
}