• 禁止出微信浏览器以外的浏览器进入页面


    (function() {
          var useragent = navigator.userAgent;
          if (useragent.match(/MicroMessenger/i) != "MicroMessenger") {
            // window.location.href = "wxError.html";//若不是微信浏览器,跳转到温馨error页面
            let body = `<div class="weui_msg">
                            <div class="weui_icon_area">
                                <i class="weui_icon_info weui_icon_msg"></i>
                            </div>
                            <div class="weui_text_area">
                                <h4 class="weui_msg_title">请在微信客户端打开链接</h4>
                            </div>
                        </div>`;
            let head = `<title>抱歉,出错了</title>
                        <meta charset="utf-8">
                        <meta name=viewport content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
                        <link rel="stylesheet" type="text/css" href="https://res.wx.qq.com/open/libs/weui/0.4.1/weui.css">`;
            document.head.innerHTML = head;
            document.body.innerHTML = body;
          }
        })();
    

      在app.vue文件中的create中写上这个

  • 相关阅读:
    django email用法
    django ImageField用法
    django集成微博内容
    python读写zip文件
    读写文件
    404渲染
    bzoj1297 / P4159 [SCOI2009]迷路
    bzoj1009 / P3193 [HNOI2008]GT考试
    poj2115 C Looooops(exgcd)
    bzoj1407 / P2421 [NOI2002]荒岛野人(exgcd)
  • 原文地址:https://www.cnblogs.com/wang-xx/p/13182824.html
Copyright © 2020-2023  润新知