$.ajax({
url : '', //接口路径
type : "post", //请求方式
dataType : "json", //数据类型
data : {}, //后台需要的参数
cache : false, //ajax缓存
async : false, //是否为异步请求
success : function() { //请求成功
if('success'== textStatus) {
debugger;
layer.msg(data.message, {time: 2000, icon:6}); //layer.msg()弹框插件
if(1 == data.status){ //后台返回数据进行确认(接口文档)
setTimeout(function(){ //加入定时器配合弹框
window.location.href = ''; //页面跳转
}, 2000);
}
}
},
error : function() { //请求失败
layer.msg();
}
});