微信背景默认不是白色需设置body
const Proms = zhi => {
console.log(param)
return new Promise((resovle, reject) => {
$.ajax({
"type": zhi.type || "get",
"async": zhi.async || true,
"url": zhi.url,
"data": zhi.data || "",
"success": res => {
resovle(res);
},
"error": err => {
reject(err);
}
})
})
}
let step = () => {
Proms({
"url": "http://47.99.195.63:8090/api/user/inviteIncomeRecord",
"type": "get"
}).then(res => {
console.log("");
}).catch(err => {
console.log("");
})
}
step()
第一个请求
*/
let step1 = () => {
ajaxPromise({
"url":"",
}).then(res => {
console.log("第一个请求正确返回==>"+res);
step2(res);
}).catch(err => {
console.log("第一个请求失败");
})
}
/*
第二个请求
*/
let step2 = (res) => {
ajaxPromise({
"type":"get",
"url":"",
"data":{"name":res}
}).then(res => {
console.log("第二个请求正确返回==>"+res);
}).catch(err => {
console.log("第二个请求失败==>"+err);
})
}
step1();
解决n个ajax传值问题,第二ajax需第一个ajax返回值,