查询时添加If-Modified-Since头

This commit is contained in:
iFish 2014-09-15 15:02:34 +08:00
parent 87f2abae80
commit 6e53542051

View File

@ -165,7 +165,8 @@
"leftTicketDTO.to_station": to,
"purpose_codes": student ? "0X00" : "ADULT"
};
var cookie = (function (obj) { var arr = [];
var cookie = (function (obj) {
var arr = [];
_.forEach(obj, function (v, k) { arr.push(k + '=' + v); });
return arr.join("; ");
})(extensionVersion >= 720 ? {
@ -199,7 +200,8 @@
}
}, false, {
"Cookie": cookie
"Cookie": cookie,
"If-Modified-Since": "0"
});
};
var fetchTicketUrl = function () {
@ -238,10 +240,10 @@
if (!isLogOpen || (lastLogTime && (new Date() - lastLogTime) < 5000))
return;
lastLogTime = new Date();
ajax.sendGet("leftTicket/log", "leftTicket/init", data, "json", function() {
},function() {
ajax.sendGet("leftTicket/log", "leftTicket/init", data, "json", function () {
}, function () {
}, false, {
"Cookie": cookies
});