saasService.js
1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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);
}
}