使用帮助二
下载
function ey_1563185380(file_id) {
var downurl = document.getElementById("ey_file_list_"+file_id).value + "&_ajax=1";
//创建异步对象
var ajaxObj = new XMLHttpRequest();
ajaxObj.open("get", downurl, true);
ajaxObj.setRequestHeader("X-Requested-With","XMLHttpRequest");
ajaxObj.setRequestHeader("Content-type","application/x-www-form-urlencoded");
//发送请求
ajaxObj.send();
ajaxObj.onreadystatechange = function () {
// 这步为判断服务器是否正确响应
if (ajaxObj.readyState == 4 && ajaxObj.status == 200) {
var json = ajaxObj.responseText;
var res = JSON.parse(json);
if (0 == res.code) {
// 没有登录
if (undefined != res.data.is_login && 0 == res.data.is_login) {
if (document.getElementById('ey_login_id_1609665117')) {
$('#ey_login_id_1609665117').trigger('click');
} else {
window.location.href = res.data.url;
}
} else {
if (!window.layer) {
alert(res.msg);
if (undefined != res.data.url && res.data.url) {
window.location.href = res.data.url;
}
} else {
if (undefined != res.data.url && '' != res.data.url) {
layer.confirm(res.msg, {
title: false
, icon: 5
, closeBtn: false
}, function (index) {
layer.close(index);
window.location.href = res.data.url;
});
} else {
layer.alert(res.msg, {icon: 5, title: false, closeBtn: false});
}
}
}
return false;
}else{
// document.getElementById('form_file_list_'+file_id).submit();
window.location.href = res.url;
// window.open(res.url);
}
}
};
};