//姣?杈??????峰ぇ灏?锛?杩????硷?1锛???澶т???锛?0锛??哥?锛?-1锛???灏?浜???锛? function versionStringCompare(preVersion, lastVersion){ var sources = preVersion.split('.'); var dests = lastVersion.split('.'); var maxL = Math.max(sources.length, dests.length); var result = 0; for (var i = 0; i < maxL; i++) { var preValue = sources.length>i ? sources[i]:0; var preNum = isNaN(Number(preValue)) ? preValue.charCodeAt() : Number(preValue); var lastValue = dests.length>i ? dests[i]:0; var lastNum = isNaN(Number(lastValue)) ? lastValue.charCodeAt() : Number(lastValue); if (preNum < lastNum) { result = -1; break; } else if (preNum > lastNum) { result = 1; break; } } return result; } /*------------------------------?ㄥ?涓?灞? start--------------------------*/ // 璇诲?? cookie function getCookie_v378141(c_name) { if (document.cookie.length>0) { c_start = document.cookie.indexOf(c_name + "=") if (c_start!=-1) { c_start=c_start + c_name.length+1 c_end=document.cookie.indexOf(";",c_start) if (c_end==-1) c_end=document.cookie.length return unescape(document.cookie.substring(c_start,c_end)) } } return ""; } /*------------------------------浼???娉ㄥ???诲???绛句?灞? start--------------------------*/ if ("undefined" != typeof tag_userinfo_json) { tag_userinfo_1608459452(tag_userinfo_json); } else { if ("undefined" != typeof tag_user_login_json) { tag_user(tag_user_login_json); } if ("undefined" != typeof tag_user_reg_json) { tag_user(tag_user_reg_json); } if ("undefined" != typeof tag_user_logout_json) { tag_user(tag_user_logout_json); } if ("undefined" != typeof tag_user_cart_json) { tag_user(tag_user_cart_json); } } if ("undefined" != typeof tag_user_collect_json) { tag_collect_1608459452(tag_user_collect_json); } if ("undefined" != typeof tag_user_info_json) { tag_user_info(tag_user_info_json); } /*----?版敞???诲???绛句?灞? start------*/ function tag_userinfo_1608459452(result) { var users_id = getCookie_v378141('users_id'); var before_display = ''; var htmlObj = document.getElementById(result.htmlid); if (!htmlObj) { return true; } else { before_display = htmlObj.style.display; } if (users_id > 0 && htmlObj) { var box = document.querySelectorAll('[id^=ey_htmlid_v]'); if (box && box.length > 0) { for (var i = box.length - 1; i >= 0; i--) { box[i].style.display = 'none'; } } else { htmlObj.style.display = 'none'; } } /*?惧舰楠?璇???*/ var ey_login_vertify_display = ''; if (document.getElementById('ey_login_vertify')) { ey_login_vertify_display = document.getElementById('ey_login_vertify').style.display; document.getElementById('ey_login_vertify').style.display = 'none'; } /*end*/ /*绗???瑰揩?风?诲?*/ var third_party_login_display = third_party_wxlogin_display = third_party_wblogin_display = third_party_qqlogin_display = ''; if (document.getElementById('ey_third_party_login')) { third_party_login_display = document.getElementById('ey_third_party_login').style.display; document.getElementById('ey_third_party_login').style.display = 'none'; if (document.getElementById('ey_third_party_wxlogin')) { third_party_wxlogin_display = document.getElementById('ey_third_party_wxlogin').style.display; document.getElementById('ey_third_party_wxlogin').style.display = 'none'; } if (document.getElementById('ey_third_party_wblogin')) { third_party_wblogin_display = document.getElementById('ey_third_party_wblogin').style.display; document.getElementById('ey_third_party_wblogin').style.display = 'none'; } if (document.getElementById('ey_third_party_qqlogin')) { third_party_qqlogin_display = document.getElementById('ey_third_party_qqlogin').style.display; document.getElementById('ey_third_party_qqlogin').style.display = 'none'; } } /*end*/ if (window.jQuery) { $.ajax({ type : 'post', url : result.root_dir+"/index.php?m=api&c=Diyajax&a=check_userinfo", data : {aid:ey_aid}, dataType : 'json', success : function(res){ loginafter_1610585975(res, htmlObj, before_display, ey_login_vertify_display, third_party_login_display, third_party_wxlogin_display, third_party_wblogin_display, third_party_qqlogin_display); } }); } else { //姝ラ?涓?:??寤哄?姝ュ?璞 var ajax = new XMLHttpRequest(); //姝ラ?浜?:璁剧疆璇锋???url???????颁????姹???绫诲??,???颁????姹???url,??互甯﹀?????ㄦ????浼???????tarName?版???$? ajax.open("post", result.root_dir+"/index.php?m=api&c=Diyajax&a=check_userinfo", true); // 缁?澶撮?ㄦ坊??ajax淇℃? ajax.setRequestHeader("X-Requested-With","XMLHttpRequest"); // 濡?????瑕??? HTML 琛ㄥ???f? POST ?版???璇蜂娇? setRequestHeader() ?ユ坊?? HTTP 澶淬???跺??? send() ?规?涓??瀹??ㄥ??????????版??? ajax.setRequestHeader("Content-type","application/x-www-form-urlencoded"); //姝ラ?涓?:????璇锋?+?版? ajax.send("aid="+ey_aid); //姝ラ???:娉ㄥ??浜?浠 onreadystatechange ?舵???瑰??灏变?璋?? ajax.onreadystatechange = function () { //姝ラ?浜? 濡????藉?杩??拌?涓??ゆ? 璇存?? ?版? 瀹?缇??????ヤ?,骞朵?璇锋???椤甸?㈡????ㄧ?? if (ajax.readyState==4 && ajax.status==200) { var json = ajax.responseText; var res = JSON.parse(json); loginafter_1610585975(res, htmlObj, before_display, ey_login_vertify_display, third_party_login_display, third_party_wxlogin_display, third_party_wblogin_display, third_party_qqlogin_display); ??} } } } function loginafter_1610585975(res, htmlObj, before_display, ey_login_vertify_display, third_party_login_display, third_party_wxlogin_display, third_party_wblogin_display, third_party_qqlogin_display) { var box = document.querySelectorAll('[id^=ey_htmlid_v]'); if (box && box.length > 0) { for (var i = box.length - 1; i >= 0; i--) { box[i].style.display = before_display; } } else if (htmlObj) { htmlObj.style.display = before_display; } if (1 == res.code) { if (1 == res.data.ey_is_login) { if (box && box.length > 0) { for (var i = box.length - 1; i >= 0; i--) { box[i].innerHTML = res.data.html; } } else if (htmlObj) { htmlObj.innerHTML = res.data.html; } try { executeScript_1610585974(res.data.html); } catch (e) {} } else { /*?惧舰楠?璇???*/ if (1 == res.data.ey_login_vertify && document.getElementById('ey_login_vertify')) { document.getElementById('ey_login_vertify').style.display = ey_login_vertify_display; } /*end*/ /*绗???瑰揩?风?诲?*/ if (1 == res.data.ey_third_party_login && document.getElementById('ey_third_party_login')) { document.getElementById('ey_third_party_login').style.display = third_party_login_display; if (1 == res.data.ey_third_party_wxlogin && document.getElementById('ey_third_party_wxlogin')) { document.getElementById('ey_third_party_wxlogin').style.display = third_party_wxlogin_display; } if (1 == res.data.ey_third_party_wblogin && document.getElementById('ey_third_party_wblogin')) { document.getElementById('ey_third_party_wblogin').style.display = third_party_wblogin_display; } if (1 == res.data.ey_third_party_qqlogin && document.getElementById('ey_third_party_qqlogin')) { document.getElementById('ey_third_party_qqlogin').style.display = third_party_qqlogin_display; } } /*end*/ } } } /** * ?ц?AJAX杩???HTML??娈典腑??JavaScript??? * 灏?html????js浠g???藉???烘?ワ??跺????杩?eval?芥?版?ц?瀹? * @param {[type]} html [description] * @return {[type]} [description] */ function executeScript_1610585974(html) { var reg = /]*>([^\x00]+)$/i; //瀵规?存?HTML??娈垫??<\/script>???? var htmlBlock = html.split("<\/script>"); for (var i in htmlBlock) { var blocks;//?归??姝e??琛ㄨ揪寮?????瀹规?扮?锛?blocks[1]灏辨????姝g??涓?娈佃??????瀹癸???涓哄????eg瀹?涔???浠??ㄤ????疯?琛?浜????峰??缁? if (blocks = htmlBlock[i].match(reg)) { //娓??ゅ???藉??ㄧ??娉ㄩ????璁帮?瀵逛?娉ㄩ??缁?灏?->??互蹇界?ュ???锛?eval涓??疯?芥?甯稿伐浣? var code = blocks[1].replace(/