ajax封装 -- 更名为 Ajax

This commit is contained in:
zhuangqian 2017-01-26 09:36:36 +08:00
parent e42ee610e9
commit 817f36e73e
12 changed files with 15 additions and 15 deletions

View File

@ -33,7 +33,7 @@
var appindex = appLoading();
var $form = $(this);
var ajax = new $ax($form.attr("data-url"), function(data){
var ajax = new Ajax($form.attr("data-url"), function(data){
if (data.code === 0) {
clearLoading(appindex);
layer.msg(data.message, {shift: 1});

View File

@ -103,7 +103,7 @@
icon: 3,
btn: ['确定', '取消'] //按钮
}, function () {
var ajax = new $ax("${ctxPath}/cache/theme", function(data){
var ajax = new Ajax("${ctxPath}/cache/theme", function(data){
if (data.code === 0) {
window.location.href="${ctxPath}/";
} else {

View File

@ -102,7 +102,7 @@
onCheck: onCheck${id}_ipt
}
};
var treeList = new $ax("${ctxPath}/combotree/getTreeList", function(data){
var treeList = new Ajax("${ctxPath}/combotree/getTreeList", function(data){
if (data.code === 0) {
$.fn.zTree.init($("#tree${id}_ipt"), setting, data.data);
} else {
@ -121,7 +121,7 @@
}
function initComboTreeName${id}_ipt(val) {
var treeName = new $ax("${ctxPath}/combotree/getTreeListName", function(data){
var treeName = new Ajax("${ctxPath}/combotree/getTreeListName", function(data){
if (data.code === 0) {
$("#${id}_ipt").val(data.data);
} else {

View File

@ -148,7 +148,7 @@
var $form = $(this);
var $imgcode=$("#"+$form.attr("data-imgcode"));
var ajax = new $ax($form.attr("action"), function(data){
var ajax = new Ajax($form.attr("action"), function(data){
if (data.code === 0) {
layer.msg(data.message, {shift: 1});
setTimeout(function(){window.location.href = "${ctxPath}/";}, 1200);

View File

@ -51,7 +51,7 @@
beforeClick: zTreeBeforeClick
}
};
var ajax = new $ax("${ctxPath}/cache/deptTreeList", function(data){
var ajax = new Ajax("${ctxPath}/cache/deptTreeList", function(data){
if(data.code===0){
$.fn.zTree.init($("#zTree"), setting, data.data);
}

View File

@ -51,7 +51,7 @@
beforeClick: zTreeBeforeClick
}
};
var ajax = new $ax("${ctxPath}/cache/dicTreeList", function(data){
var ajax = new Ajax("${ctxPath}/cache/dicTreeList", function(data){
if(data.code===0){
$.fn.zTree.init($("#zTree"), setting, data.data);
}

View File

@ -60,7 +60,7 @@
}
};
var ajax = new $ax("${ctxPath}/cache/menuTreeList", function(data){
var ajax = new Ajax("${ctxPath}/cache/menuTreeList", function(data){
if(data.code === 0){
$.fn.zTree.init($("#zTree"), setting, data.data);
}

View File

@ -53,7 +53,7 @@
}
};
var ajax = new $ax("${ctxPath}/cache/roleTreeList", function(data){
var ajax = new Ajax("${ctxPath}/cache/roleTreeList", function(data){
if(data.code === 0){
$.fn.zTree.init($("#zTree"), setting, data.data);
}

View File

@ -54,7 +54,7 @@
}
};
var ajax = new $ax("${ctxPath}/user/userTreeList", function(data){
var ajax = new Ajax("${ctxPath}/user/userTreeList", function(data){
if(data.code === 0){
$.fn.zTree.init($("#zTree"), setting, data.data);
}

View File

@ -1,5 +1,5 @@
(function () {
var $ax = function (url, success) {
var Ajax = function (url, success) {
this.url = url;
this.type = "post";
this.data = {};
@ -8,7 +8,7 @@
this.success = success;
};
$ax.prototype = {
Ajax.prototype = {
start : function () {
var me = this;
@ -54,6 +54,6 @@
//closeDialog(data);
});
window.$ax = $ax;
window.Ajax = Ajax;
} ());

View File

@ -482,7 +482,7 @@ var exwhere;
// 根据模块code生成每个工具条上面的 btn
function initMenuBtn(obj, code) {
var ajax = new $ax(BladeApp.ctxPath + "/cache/getBtn", function (data) {
var ajax = new Ajax(BladeApp.ctxPath + "/cache/getBtn", function (data) {
if (data.code === 0) {
toolbar = obj;
btnjsons = data.data;

View File

@ -46,7 +46,7 @@ $(function () {
var $form = $(this);
var $imgcode=$("#"+$form.attr("data-imgcode"));
var ajax = new $ax($form.attr("action"), function(data){
var ajax = new Ajax($form.attr("action"), function(data){
if (data.code === 0) {
layer.msg(data.message, {shift: 1});
setTimeout(function(){window.location.href = BladeApp.ctxPath + "/";}, 1200);