
        var match = location.search.match(reg)
        return match && match[1]
      }
      function createQRCode (url, wsport) {
        var $QR = document.querySelector('#qrcode')
        var QR = qrcode(0, 'L')
        url += `${wsport ? `?wsport=${wsport}&`: '?'}_wx_tpl=${url}`
        $QR.setAttribute('href', url)
        QR.addData(url)
        QR.make()
        $QR.innerHTML = QR.createImgTag(6, 12)
      }
      if (page) {
        var $preview = document.querySelector('#preview')
        var $we