saasService.js 1.18 KB
var saas = {
    // url: "http://saasapi.dituhui.com",
    url: "http://114.55.43.0:16907",
    customUrl:"http://localhost:8080",
    // ak:"ee824a89bb2b4c7cb74399bf9d5165bc",
    ak:"30bdc45ee00940cda7917d134fdb1523",
    saasHttpRequest: function (method, parameter, successComplate, errorComplate) {
        if(parameter){
            parameter.ak = saas.ak;
        }else{
            parameter = {ak:saas.ak};
        }
        var config = {
            url:saas.url + method,
            data:parameter,
            dataType:"jsonp",
            type: "POST",
            timeout: 90000,
            success: successComplate,
            error: errorComplate,
        };
        $.ajax(config);
    },
    customHttpRequest: function (method, parameter, successComplate, errorComplate) {
        if(parameter){
            parameter.ak = saas.ak;
        }else{
            parameter = {ak:saas.ak};
        }
        var config = {
            url:saas.customUrl + method,
            data:parameter,
            dataType:"json",
            type: "POST",
            timeout: 90000,
            success: successComplate,
            error: errorComplate,
        };
        $.ajax(config);
    }
}