X Tutup
Skip to content

Commit 34a63fa

Browse files
committed
update
1 parent cb0c3f7 commit 34a63fa

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

base/base.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,21 @@
22

33
function Base() {}
44

5-
Base.prototype.server = function(Ajax, data, url, callback, type, dataType) { //Server方法
6-
Ajax({
7-
data: data || {},
8-
type: type || 'get',
9-
url: url,
10-
dataType: dataType || 'json',
11-
done: (res) => {
12-
callback && callback(res);
13-
}
14-
});
5+
Base.prototype.server = function(Ajax) { //Server方法
6+
7+
var Server = Ajax;
8+
9+
return function(data, url, callback, type, dataType) {
10+
Server({
11+
data: data || {},
12+
type: type || 'get',
13+
url: url,
14+
dataType: dataType || 'json',
15+
done: (res) => {
16+
callback && callback(res);
17+
}
18+
});
19+
}
1520
};
1621

1722
Base.prototype.queryParams = function() { //获取查询字符串参数

0 commit comments

Comments
 (0)
X Tutup