当前位置:网站首页>Is the client that gets the scanning code wechat or Alipay

Is the client that gets the scanning code wechat or Alipay

2022-06-25 09:04:00 youliroam

Whether the client to scan the code is wechat or Alipay

 Produced QR code :

 Insert picture description here

1) This is how Alipay scans the code

 Please add a picture description

2) Wechat scanning code comes in like this

 Please add a picture description

3) The mobile phone comes with a browser to scan the code

 Please add a picture description

4) The mobile Google browser opens like this

 Please add a picture description

5) The computer Google browser opens like this

 Insert picture description here

 The code is as follows :


    $(function(){
    
        let client = getClient();
        alert(client);
    })


    function getClient(){
    
        let userAgent = navigator.userAgent.toLowerCase();
        alert(userAgent);
        if(userAgent.indexOf('micromessenger') != -1){
    
            return 'wechat';
        }else if(userAgent.indexOf('alipayclient') != -1){
    
            return 'alipay';
        }
        if (/ipad|iphone|midp|rv:1.2.3.4|ucweb|android|windows ce|windows mobile/.test(userAgent)) {
    
            return 'mobile';
        } else {
    
            return 'computer';
        }
    }
原网站

版权声明
本文为[youliroam]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206250737299011.html