利用captive.apple.com可以達到連接wifi的SSID信號就自動彈出portal認證頁面.
白名單captive.apple.com后將不會彈出該提示.
可是微信一鍵關注頁面是不允許跳轉到雲或其他頁面進行認證的,幾乎不給你任何機會就中斷掉wifi.一直顯示取消.我們有沒有辦法來將取消變為完成呢?
當然答案是肯定的.
首先在portal認證頁寫一個自動就連接放行該設備的IP的所有數據.
auto(); //自動登錄一個號 function auto(){ var str_a="auth.asp?usr=15336500020&pwd=15336500021"; var data_str_a=encodeToGB2312(str_a); $.ajax({ type: "GET", url: data_str_a, success: post_fun_a(), error: null, timeout: 10000, dataType: "jsonp", cache: false }); } function post_fun_a(){ }
這樣蘋果ios的portal將由取消變成完成
接下來,延時10秒后我們將這個帳戶斷開和給微信一鍵關注的按鈕css樣式修改為可用狀態(該腳本自行建立)
setTimeout(function(){close()},"10000"); function close(){ //接下來我們斷開這個號 var str_c="userinfo.asp?opt=down&u=15336500020&i=<?php echo $i;?>&_=1452669615595"; var data_str_c=encodeToGB2312(str_c); $.ajax({ type: "GET", url: data_str_c, success: post_fun_c(), error: null, timeout: 10000, dataType: "jsonp", cache: false }); } function post_fun_c(){ }
這樣我們是不是就又給當前登錄的這個帳戶斷開掉了網絡?
蘋果ios的wifi狀態可是正常顯示.與路由器的通訊也正常,只不過受路由器的控制無法正常上網服務.想繼續上網的話還得根據提示點"微信一鍵關注"或其他人認證服務.
function tijiao(){ //微信一鍵關注開始 var str_b="auth.asp?usr=15336500025&pwd=15336500026"; var data_str_b=encodeToGB2312(str_b); $.ajax({ type: "GET", url: data_str_b, success: post_fun_b(), error: null, timeout: 10000, dataType: "jsonp", cache: false }); } function post_fun_b(){ } //微信部分略
看到沒?正常提供服務的帳戶我采用了另外一個號.
還得提示下變量i是怎么來的
由上頁一頁跳轉過來,url地址參數
<?php if(isset($_REQUEST['i'])){ $i = $_REQUEST['i']; }else{ $i="您是非法用戶!"; } ?>
好吧,跳轉頁htm的代碼也補出來
<html> <head> </head> <body> <SCRIPT> function request(paras){ var url = location.href; var paraString = url.substring(url.indexOf("?")+1,url.length).split("&"); var paraObj = {} for (i=0; j=paraString[i]; i++){ paraObj[j.substring(0,j.indexOf("=")).toLowerCase()] = j.substring(j.indexOf("=")+1,j.length); } var returnValue = paraObj[paras.toLowerCase()]; if(typeof(returnValue)=="undefined"){ return ""; }else{ return returnValue; } } var ip = request("i"); var ld = request("ld"); //alert(ip); window.location.href='auto.php?i='+ip+'&ld='+ld; </SCRIPT> </body> </html>
完整頁面可向鋼鍋索取QQ:264059790