Micro letter be prevented from accessing the website how to deal with? 366API recovery solutions are normally sealed pages accessible from within the micro-channel

demand analysis

We do marketing or promotion when the link is vulnerable to interception micro-channel, resulting in open prompt in the micro letter "stopped to visit the page", it can not app downloads and so on. Then you need to download the app directly within the micro-channel function, many users do not know such an implementation, so for this problem, close this article to share treatment options before our company. First, if we do not have professional technical team, we can look for a provider of a team of this technology, we have been using before is 366API platform interface, the results were good, very stable. Then if we have our own technical team, a jump can write their own programs, reference case see below.

I. First, we talk about the use of 366API platform:

1 Use your browser to open the platform we need to use 366API

2. Copy and paste the link into the api tool box, click on the link and generates a short jump two-dimensional code

3, the two-dimensional code and the short connecting replication micro channel to open or scan code to link.

Second, secondly we talk about how to build a micro-channel jumps browser source code:

1, ios end micro-channel Masking prompt access to the open source browser

<style type="text/css">   
    .mask {     
            position: absolute; top: 0px; filter: alpha(opacity=60); background-color: #777;   
            z-index: 1002; left: 0px;   
            opacity:0.5; -moz-opacity:0.5;   
        }   
</style>  
<pre class="html" name="code"><script type="text/javascript">   
    //兼容火狐、IE8 
    //显示遮罩层  
    function showMask(){   
        $("#mask").css("height",$(document).height());   
        $("#mask").css("width",$(document).width());   
        $("#mask").show();   
    }
    //隐藏遮罩层
    function hideMask(){   
        
        $("#mask").hide();   
    }
   
</script>
<div id="mask" class="mask"></div>  
<a href="javascript:;" onclick="showMask()" >点我显示遮罩层</a><br />

2, Android end micro-channel automatic wake default browser to open Web links code

? < PHP
 // unified call micro-channel whitelist Interface: https://api.366api.cn/mjgj/link/GetOpenLink?callback=getOpenLink & rurl = https://dc2.jd.com/auto.php?service=transfer & type = pms & to = (here spliced own content address such as HTTP: // mjbbs.jd.com/data/attachment/forum/201806/08/173526pb2zpjzzooo2ofze.jpg) 
IF ($ _GET [ ' T ' ]) {
 // the include ( "ADMIN / the config.php");
 // the include ( "ADMIN / function.php"); 
$ code = $ _GET [ ' T ' ]; 
$ info = Query ( " jump_logs " , " WHERE code = ' " . $code . " ' " );
 IF ($ info [ ' code ' ] == ' ' ) { 
    echo ' jumps fails ' ; 
    Exit ( 0 ); 
} 
IF ($ info [ ' State ' ] == ' . 1 ' ) {
 IF ($ info [ ' COUNT ' ]> = $ info [ ' NUM ' ]) { 
    echo ' jumps fails ' ; 
    Exit ( 0 );
}
$time = strtotime($info[' Time ' ]);
     IF (Time ()> $ Time) { 
        echo ' jumps fails ' ; 
        Exit; 
    } 
} the else { 
    echo ' jumps fails ' ; 
    Exit; 
} 
IF ($ info [ ' www_url ' ] == '' ) { 
    echo ' please configure the landing page ' ; 
    Exit; 
} the else { 
    $ w_url_code = $ info [ ' rl is an ' ]; 
}
 >?
? < PHP 
function get_ticket ($ code) { 
    // Initialization 
    $ CH = curl_init (); 
    curl_setopt ($ CH, CURLOPT_SSL_VERIFYPEER, FALSE); // HTTPS request does not verify the certificate and hosts 
    $ headers = Array (); 
    $ headers [] = ' the User-- Agent: the Mozilla / 5.0 (the iPhone; the CPU the iPhone the OS like the Mac the OS X-11_1_2; ZH-the CN) AppleWebKit / 537.51.1 (KHTML, like the Gecko) Mobile / 15B202 UCBrowser / 11.7.7.1031 Mobile AliApp (TUnionSDK / 0.1 .20) ' ; 
    $ headers [] = ' the Referer: https://m.mall.qq.com/release/?busid=mxd2&ADTAG=jcp.h5.index.dis ' ; 
    $ headers [] = 'Content-Type:application/x-www-form-urlencoded; charset=UTF-8';
 
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    $content = curl_exec($ch);
    curl_close($ch);
    //$arr = json_decode($content,1);
    //if($arr['success'] == '1'){
    //    $shotCode = $arr['shotCode'];
    //}else{
    //    $shotCode = '';
    //}
    //preg_match('/openlink\":\"(.*?)\"}/',$content,$result);
    //$url = $result[1];
     
    preg_match('/href=\"(.*?)#wechat/',$content,$result);
    $url = $result[1];
    return $url;
}
    $time = time()-$info['ticket_time'];
    $minute=floor($time/60);
    query_update ( "jump_logs", "count=count+1". " where code='" . $code . "'" );
    if($minute >= 59){
        //如果超过1小时,更新ticket
        $url = get_ticket($w_url_code);
        if($url){
        query_update ( "jump_logs", "ticket_time='".time()."', ticket='" . $url . "' where code='" . $code . "'" );
        $ticket_url = $url.'#';
        if(strpos($_SERVER['HTTP_USER_AGENT'], 'baiduboxapp')||strpos($_SERVER['HTTP_USER_AGENT'],'Baiduboxapp')) {//安卓百度手机APP
            echo '<script>window.location.href = "bdbox://utils?action=sendIntent&minver=7.4&params=%7b%22intent%22%3a%22'.$url.'%23wechat_redirect%23wechat_redirect%23Intent%3bend%22%7d";</script>';
            }else{
                echo '<script>window.location.href = "'.$ticket_url.'";</script>';
            }
        }
    }else{
        $ticket_url = $info['ticket'].'#';
        if(strpos($_SERVER['HTTP_USER_AGENT'], 'baiduboxapp')||strpos($_SERVER['HTTP_USER_AGENT'], 'baiduboxapp')){//安卓百度手机APP
            echo '<script>window.location.href = "bdbox://utils?action=sendIntent&minver=7.4&params=%7b%22intent%22%3a%22'.$info['ticket'].'%23wechat_redirect%23wechat_redirect%23Intent%3bend%22%7d";</script>';
            }else{
                echo '<script>window.location.href = "'.$ticket_url.'";</script>';
            }
    }
}
?>
<!详情可参考:http://www.366api.cn--> 

 

Guess you like

Origin www.cnblogs.com/jinlous/p/10945689.html
Recommended