1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
var reqBackup; function login(url, param) { var data = http.fetch(url, param); if (data.code === 200 && reqBackup.url) { reqBackup = {}; fetchData(reqBackup.url, reqBackup.param, reqBackup.callback); } }
function fetchData(url, param, callback) { var data = http.fetch(url, param); if (data.code === 606) { reqBackup.url = url; reqBackup.param = param; reqBackup.callback = callback; login(); return; }
if (data.code === 200) { callback(data); return; } }
|