吴昊虎 4 месяцев назад
Сommit
b9e19aebfa

+ 14 - 0
.gitignore

@@ -0,0 +1,14 @@
+# Windows
+[Dd]esktop.ini
+Thumbs.db
+$RECYCLE.BIN/
+
+# macOS
+.DS_Store
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+
+# Node.js
+node_modules/

+ 45 - 0
app.js

@@ -0,0 +1,45 @@
+//app.js
+import util from './utils_sand/util.js';
+App({
+  onError: function (err) {
+    // wx.showToast({
+    //   title: '下单失败',
+    //   icon: 'none',
+    //   duration: 2000
+    // })
+
+  },
+  onLaunch: function (e) {
+    wx.login({
+      success: res => {
+      }
+    })
+    wx.getSetting({
+      success: res => {
+        if (res.authSetting['scope.userInfo']) {
+          wx.getUserInfo({
+            success: res => {
+              this.globalData.userInfo = res.userInfo
+              if (this.userInfoReadyCallback) {
+                this.userInfoReadyCallback(res)
+              }
+            }
+          })
+        }
+      }
+    })
+  },
+  onShow:function(e){
+    // wx.setStorageSync('info', e)
+    var date = new Date();
+  },
+  globalData: {
+    userInfo: null
+  },
+  Tips: function (opt, to_url) {
+    return util.Tips(opt, to_url);
+  },
+  onHide: function () {
+   
+  }
+})

+ 15 - 0
app.json

@@ -0,0 +1,15 @@
+{
+  "pages": [
+    "pages/index/index",
+    "pages/back_sand/back",
+    "pages/zf/index"
+  ],
+  "window": {
+    "backgroundTextStyle": "light",
+    "navigationBarBackgroundColor": "#fff",
+    "navigationBarTitleText": "WeChat",
+    "navigationBarTextStyle": "black"
+  },
+
+  "sitemapLocation": "sitemap.json"
+}

+ 14 - 0
app.wxss

@@ -0,0 +1,14 @@
+/**app.wxss**/
+.container {
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: space-between;
+  padding: 10rpx 0;
+  box-sizing: border-box;
+} 
+.button::after{
+  background-color: #fff ;
+  line-height:0.01
+}

+ 6 - 0
cloudfunctions/public/config.json

@@ -0,0 +1,6 @@
+{
+  "permissions": {
+    "openapi": [
+    ]
+  }
+}

+ 30 - 0
cloudfunctions/public/index.js

@@ -0,0 +1,30 @@
+// 云函数入口文件
+const cloud = require('wx-server-sdk')
+
+// cloud.init({env:'szjl-9g9sqgqwb4b6495e'});
+cloud.init();
+
+// 云函数入口函数
+exports.main = async (event, context) => {
+  const wxContext = cloud.getWXContext()
+  switch (event.action) {
+    case 'getUrlScheme': {
+      return getUrlScheme(event.token_id)
+    }
+  }
+
+  return 'action not found'
+}
+
+async function getUrlScheme(token_id) {
+  return cloud.openapi.urlscheme.generate({
+    jumpWxa: {
+      path: '/pages/zf/index', // <!-- replace -->
+      query: 'token_id=' + token_id+ '&back=1'+'&funcCode=02010006' ,
+    },
+    // 如果想不过期则置为 false,并可以存到数据库
+    isExpire: true,
+    // 一分钟有效期
+    expireTime: parseInt(Date.now() / 1000 + 1000),
+  })
+}

+ 14 - 0
cloudfunctions/public/package.json

@@ -0,0 +1,14 @@
+{
+  "name": "public",
+  "version": "1.0.0",
+  "description": "",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "author": "",
+  "license": "ISC",
+  "dependencies": {
+    "wx-server-sdk": "~2.3.2"
+  }
+}

+ 13 - 0
config_sand.js

@@ -0,0 +1,13 @@
+
+module.exports = {
+  // APPID: 'wxf7fcbc6f35ad73c0',
+  // APPID: 'wx6edc693abbd5031e',
+  APPID: 'wxbeec5a14b6305992',
+  URL:'https://wxmini.mixienet.com.cn/index/',
+  // SECRET: 'ef7b305b2a277c6d18588b57aac94595',
+  USERCODE: 'EBCd5IIXjcAe1jNHwmDBDjzI4DzJiAnF8SHI3nWN/OX6IE4ZCByXvqwnFH0xZrggMx0b9YrEeZMhjaAM1QcVSDXvJUEwNFUNoQdkRBhDVVY9rFpaa0lSboZu9VWj5NToh+XNYf7Z4SQgieobauoo+9+yyuT5NmYh7kGYc4uFpvU=',
+  // USERCODE: wx.getExtConfigSync().USERCODE,
+  USE_PRIVATEKEY: '-----BEGIN RSA PRIVATE KEY-----MIICXAIBAAKBgQCGgPZCtvBdVyqE7s6k8m801nlu3LvshI+0qaiOn1XCewaDzz6J6fgo7NnmPP2UQBZ5/m+Zm3aFSKFyMgh4EeXzus6L5tRtN3wXwMExzv5FZz2Zfhjmdfe0Y3Jg8ZaIb8eF6lzAO8sU8dCfEZHj0J2ak7OpivsVJAVHc80muTgPXQIDAQABAoGAFHOVfk1svPSdDXt2RlRqnmEiM74ygOMjKrhFXfJSSvED65TekH/X8PkapMyPTjR0dnY+p9+gpOGHUuLSsNcf3LenkLeJVyFKKK1lWLvXl5+QJ6vUaKZG8UytU6GGYoFXEXtVb2w08dS4PuRzXaEAP0jvTnDKnY3q431FXkc0jE0CQQDRsQRTHsnVMui8d4h8vFQ8ztjYsYb3McL5iEqWVq9u5/e+IYZ+3g8+KPgX3fnHxBB7j0gKrF95/7pjNJXqbhPzAkEApDUuMvxLRusvY0nWgUmV79bx3k4OX+D0OURuS/07olHUJEuYpU6xwXledegqWko71pD2Zb4eLsaZrKp1GWwzbwJAJM06gxQOPDq5Ggqoi6vJ5PowmKdflpbHL2A6JvSDyaUwl8/ueOmkJzathBLTOboxYl4dOLJT92doYOzjusci/QJANhAQQtcPzayW8ICZ7/0TMWC6Ry+5ydVdcxFVow0fuiRozP5apmpPWdykvfsPHqT8KHuXtA2xEENwywlf/lvCXwJBAI8Q58l86l/LBHYAcX6ES2tHCUE7FSx6ZgDwf0XNIiyCT3rrG/JL9TZpJAprd9+BjHqUkQinXOJzeQzufKs71tw=-----END RSA PRIVATE KEY------',
+  USE_PUBLICKEY:'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCGgPZCtvBdVyqE7s6k8m801nlu3LvshI+0qaiOn1XCewaDzz6J6fgo7NnmPP2UQBZ5/m+Zm3aFSKFyMgh4EeXzus6L5tRtN3wXwMExzv5FZz2Zfhjmdfe0Y3Jg8ZaIb8eF6lzAO8sU8dCfEZHj0J2ak7OpivsVJAVHc80muTgPXQIDAQAB',
+  MYpublicKey:'-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArvTsXUcrqTbitJVOrXkk+6xTFFhZwxIc9dFe31C2G+wr7+0nnDhL/ugTO4rOBDUCrDeSeZvnqDqfAeOZnNPYFYC5mVDzKOxIydoXs653KWdOvFZxk3ALhgMOzBPcIbxGnC2Xpcsk0jbjA6X1YM8XTlVc5KbGR+j3eFdJU9yEtTTLxtoIiZpnAAFPgMPj7HrDZVp/lJRBkwrKfrUPb/EEZES6PtWrtQ4NQvSJ0Lf9b5lqTGVntcXjEDP3W6vdvMfBj8G2QyGutHUmHEOsIf6Cf8Avzwv6YzhgRkBPXyusOaCPft1yhrlINcIIxsOI5ob5D/A5iOaWM9SH0tUhFjzJdQIDAQAB-----END PUBLIC KEY-----'
+}

+ 10 - 0
ext.json

@@ -0,0 +1,10 @@
+{
+  "extEnable": true,
+  "extAppid": "wx2ce881915a6b9b6c",
+  "directCommit": false,
+  "ext": {
+    "name": "wechat",
+    "APPID": "wx2ce881915a6b9b6c",
+    "URL":"https://wxmini.mixienet.com.cn/index/"
+  }
+}

+ 221 - 0
h5/jump_mp.html

@@ -0,0 +1,221 @@
+<html>
+  <head>
+    <title>打开小程序</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
+    <script>
+      window.onerror = e => {
+        console.error(e)
+        alert('发生错误' + e)
+      }
+    </script>
+    <!-- weui 样式 -->
+    <link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/2.4.1/weui.min.css"></link>
+    <!-- 调试用的移动端 console -->
+    <!-- <script src="https://cdn.jsdelivr.net/npm/eruda"></script> -->
+    <!-- <script>eruda.init();</script> -->
+    <!-- 公众号 JSSDK -->
+    <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
+    <!-- 云开发 Web SDK -->
+    <script src="https://res.wx.qq.com/open/js/cloudbase/1.1.0/cloud.js"></script>
+    <script>
+      function docReady(fn) {
+        if (document.readyState === 'complete' || document.readyState === 'interactive') {
+          fn()
+        } else {
+          document.addEventListener('DOMContentLoaded', fn);
+        }
+      }
+
+      docReady(async function() {
+        var ua = navigator.userAgent.toLowerCase()
+        var isWXWork = ua.match(/wxwork/i) == 'wxwork'
+        var isWeixin = !isWXWork && ua.match(/micromessenger/i) == 'micromessenger'
+        var isMobile = false
+        var isDesktop = false
+        if (navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|IEMobile)/i)) {
+          isMobile = true
+        } else {
+          isDesktop = true
+        }
+
+        var token_id = getQueryString("token_id");
+        var path = "/pages/zf/index?token_id=" + token_id +'&back=1'+'&funcCode=02010006';
+        document.getElementById("launch-btn").setAttribute("path",path);
+
+        if (isWeixin) {
+          var containerEl = document.getElementById('wechat-web-container')
+          containerEl.classList.remove('hidden')
+          containerEl.classList.add('full', 'wechat-web-container')
+
+          var launchBtn = document.getElementById('launch-btn')
+          launchBtn.addEventListener('ready', function (e) {
+            console.log('开放标签 ready')
+          })
+          launchBtn.addEventListener('launch', function (e) {
+            console.log('开放标签 success')
+          })
+          launchBtn.addEventListener('error', function (e) {
+            console.log('开放标签 fail', e.detail)
+          })
+
+          wx.config({
+            // debug: true, // 调试时可开启
+            appId: 'wxcdea3d211ab61546', // <!-- replace -->
+            timestamp: 0, // 必填,填任意数字即可
+            nonceStr: 'nonceStr', // 必填,填任意非空字符串即可
+            signature: 'signature', // 必填,填任意非空字符串即可
+            jsApiList: ['chooseImage'], // 必填,随意一个接口即可 
+            openTagList:['wx-open-launch-weapp'], // 填入打开小程序的开放标签名
+          })
+        } else if (isDesktop) {
+          // 在 pc 上则给提示引导到手机端打开
+          var containerEl = document.getElementById('desktop-web-container')
+          containerEl.classList.remove('hidden')
+          containerEl.classList.add('full', 'desktop-web-container')
+        }  else {
+          var containerEl = document.getElementById('public-web-container')
+          containerEl.classList.remove('hidden')
+          containerEl.classList.add('full', 'public-web-container')
+          var c = new cloud.Cloud({
+            // 必填,表示是未登录模式
+            identityless: true,
+            // 资源方 AppID
+            resourceAppid: 'wxcdea3d211ab61546', // <!-- replace -->
+            // 资源方环境 ID
+            resourceEnv: 'szjl-9g9sqgqwb4b6495e', // <!-- replace -->
+          })
+          await c.init()
+          window.c = c
+
+          var buttonEl = document.getElementById('public-web-jump-button')
+          var buttonLoadingEl = document.getElementById('public-web-jump-button-loading')
+          try {
+            await openWeapp(() => {
+              buttonEl.classList.remove('weui-btn_loading')
+              buttonLoadingEl.classList.add('hidden')
+            },token_id)
+          } catch (e) {
+            buttonEl.classList.remove('weui-btn_loading')
+            buttonLoadingEl.classList.add('hidden')
+            throw e
+          }
+        }
+      })
+
+      function getQueryString(name) {
+          var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+          var reg_rewrite = new RegExp("(^|/)" + name + "/([^/]*)(/|$)", "i");
+          var r = window.location.search.substr(1).match(reg);
+          var q = window.location.pathname.substr(1).match(reg_rewrite);
+          if(r != null){
+              return unescape(r[2]);
+          }else if(q != null){
+              return unescape(q[2]);
+          }else{
+              return null;
+          }
+      }
+
+      async function openWeapp(onBeforeJump,token_id) {
+        var c = window.c
+        const res = await c.callFunction({
+          name: 'public',
+          data: {
+            action: 'getUrlScheme',
+            token_id: token_id
+          },
+        })
+        console.warn(res)
+        if (onBeforeJump) {
+          onBeforeJump()
+        }
+        location.href = res.result.openlink
+      }
+    </script>
+    <style>
+      .hidden {
+        display: none;
+      }
+
+      .full {
+        position: absolute;
+        top: 0;
+        bottom: 0;
+        left: 0;
+        right: 0;
+      }
+
+      .public-web-container {
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+      }
+
+      .public-web-container p {
+        position: absolute;
+        top: 40%;
+      }
+
+      .public-web-container a {
+        position: absolute;
+        bottom: 40%;
+      }
+
+      .wechat-web-container {
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+      }
+
+      .wechat-web-container p {
+        position: absolute;
+        top: 40%;
+      }
+
+      .wechat-web-container wx-open-launch-weapp {
+        position: absolute;
+        bottom: 40%;
+        left: 0;
+        right: 0;
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+      }
+
+      .desktop-web-container {
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+      }
+
+      .desktop-web-container p {
+        position: absolute;
+        top: 40%;
+      }
+    </style>
+  </head>
+  <body>
+    <div class="page full">
+      <div id="public-web-container" class="hidden">
+        <p class="">正在打开 “河马付收银台”...</p> <!-- replace -->
+        <a id="public-web-jump-button" href="javascript:" class="weui-btn weui-btn_primary weui-btn_loading" onclick="openWeapp()">
+          <span id="public-web-jump-button-loading" class="weui-primary-loading weui-primary-loading_transparent"><i class="weui-primary-loading__dot"></i></span>
+          打开小程序
+        </a>
+      </div>
+      <div id="wechat-web-container" class="hidden">
+        <p class="">点击以下按钮打开 “河马付收银台”</p> <!-- replace -->
+        <!-- 跳转小程序的开放标签。文档 https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_Open_Tag.html -->
+        <wx-open-launch-weapp id="launch-btn" username="gh_47cd56883430" path="/pages/zf/index"> <!-- replace -->
+          <template>
+            <button style="width: 200px; height: 45px; text-align: center; font-size: 17px; display: block; margin: 0 auto; padding: 8px 24px; border: none; border-radius: 4px; background-color: #07c160; color:#fff;">打开小程序</button>
+          </template>
+        </wx-open-launch-weapp>
+      </div>
+      <div id="desktop-web-container" class="hidden">
+        <p class="">请在手机打开网页链接</p>
+      </div>
+    </div>
+  </body>
+</html>

BIN
image/index-banner.png


BIN
image/logo.jpg


+ 885 - 0
package-lock.json

@@ -0,0 +1,885 @@
+{
+  "requires": true,
+  "lockfileVersion": 1,
+  "dependencies": {
+    "@cloudbase/database": {
+      "version": "1.2.2",
+      "resolved": "https://registry.npmjs.org/@cloudbase/database/-/database-1.2.2.tgz",
+      "integrity": "sha512-14GPoD0vdVnfdN+4rHlMmpkxAekFklt4X2gi33iCuoZUDC62p5LWS7OuTjoronnZ4QPsZPCKm+WsjE8mVD+Hmw==",
+      "requires": {
+        "bson": "^4.0.3",
+        "lodash.clonedeep": "4.5.0",
+        "lodash.set": "4.3.2",
+        "lodash.unset": "4.5.2"
+      }
+    },
+    "@cloudbase/node-sdk": {
+      "version": "2.4.7",
+      "resolved": "https://registry.npmjs.org/@cloudbase/node-sdk/-/node-sdk-2.4.7.tgz",
+      "integrity": "sha512-gMtp+25nAJzpXTxpZzN7PTtsTdv6m7SNRszMwPpWB3pwAYyefbuOkR505iv+kYugsX6MkbgKjcCQ/F5dpNMMYw==",
+      "requires": {
+        "@cloudbase/database": "1.2.2",
+        "@cloudbase/signature-nodejs": "1.0.0-beta.0",
+        "@types/retry": "^0.12.0",
+        "agentkeepalive": "^4.1.3",
+        "is-regex": "^1.0.4",
+        "jsonwebtoken": "^8.5.1",
+        "lodash.merge": "^4.6.1",
+        "request": "^2.87.0",
+        "request-promise": "^4.2.5",
+        "retry": "^0.12.0",
+        "ts-node": "^8.10.2",
+        "xml2js": "^0.4.19"
+      }
+    },
+    "@cloudbase/signature-nodejs": {
+      "version": "1.0.0-beta.0",
+      "resolved": "https://registry.npmjs.org/@cloudbase/signature-nodejs/-/signature-nodejs-1.0.0-beta.0.tgz",
+      "integrity": "sha512-gpKqwsVk/D2PzvFamYNReymXSdvRSY90eZ1ARf+1wZ8oT6OpK9kr6nmevGykMxN1n17Gn92hBbWqAxU9o3+kAQ==",
+      "requires": {
+        "@types/clone": "^0.1.30",
+        "clone": "^2.1.2",
+        "is-stream": "^2.0.0",
+        "url": "^0.11.0"
+      }
+    },
+    "@protobufjs/aspromise": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
+      "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78="
+    },
+    "@protobufjs/base64": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",
+      "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg=="
+    },
+    "@protobufjs/codegen": {
+      "version": "2.0.4",
+      "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz",
+      "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg=="
+    },
+    "@protobufjs/eventemitter": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz",
+      "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A="
+    },
+    "@protobufjs/fetch": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz",
+      "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=",
+      "requires": {
+        "@protobufjs/aspromise": "^1.1.1",
+        "@protobufjs/inquire": "^1.1.0"
+      }
+    },
+    "@protobufjs/float": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",
+      "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E="
+    },
+    "@protobufjs/inquire": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz",
+      "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik="
+    },
+    "@protobufjs/path": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
+      "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0="
+    },
+    "@protobufjs/pool": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",
+      "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q="
+    },
+    "@protobufjs/utf8": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
+      "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA="
+    },
+    "@types/clone": {
+      "version": "0.1.30",
+      "resolved": "https://registry.npmjs.org/@types/clone/-/clone-0.1.30.tgz",
+      "integrity": "sha1-5zZWSMG0ITalnH1QQGN7O1yDthQ="
+    },
+    "@types/long": {
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz",
+      "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w=="
+    },
+    "@types/node": {
+      "version": "10.17.59",
+      "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.59.tgz",
+      "integrity": "sha512-7Uc8IRrL8yZz5ti45RaFxpbU8TxlzdC3HvxV+hOWo1EyLsuKv/w7y0n+TwZzwL3vdx3oZ2k3ubxPq131hNtXyg=="
+    },
+    "@types/retry": {
+      "version": "0.12.0",
+      "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz",
+      "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA=="
+    },
+    "agentkeepalive": {
+      "version": "4.1.4",
+      "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.1.4.tgz",
+      "integrity": "sha512-+V/rGa3EuU74H6wR04plBb7Ks10FbtUQgRj/FQOG7uUIEuaINI+AiqJR1k6t3SVNs7o7ZjIdus6706qqzVq8jQ==",
+      "requires": {
+        "debug": "^4.1.0",
+        "depd": "^1.1.2",
+        "humanize-ms": "^1.2.1"
+      }
+    },
+    "ajv": {
+      "version": "6.12.6",
+      "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
+      "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+      "requires": {
+        "fast-deep-equal": "^3.1.1",
+        "fast-json-stable-stringify": "^2.0.0",
+        "json-schema-traverse": "^0.4.1",
+        "uri-js": "^4.2.2"
+      }
+    },
+    "arg": {
+      "version": "4.1.3",
+      "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
+      "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA=="
+    },
+    "asn1": {
+      "version": "0.2.4",
+      "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz",
+      "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==",
+      "requires": {
+        "safer-buffer": "~2.1.0"
+      }
+    },
+    "assert-plus": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
+      "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
+    },
+    "asynckit": {
+      "version": "0.4.0",
+      "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
+      "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
+    },
+    "aws-sign2": {
+      "version": "0.7.0",
+      "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
+      "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg="
+    },
+    "aws4": {
+      "version": "1.11.0",
+      "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz",
+      "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA=="
+    },
+    "base64-js": {
+      "version": "1.5.1",
+      "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
+      "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="
+    },
+    "bcrypt-pbkdf": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
+      "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
+      "requires": {
+        "tweetnacl": "^0.14.3"
+      }
+    },
+    "bluebird": {
+      "version": "3.7.2",
+      "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
+      "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg=="
+    },
+    "bson": {
+      "version": "4.3.0",
+      "resolved": "https://registry.npmjs.org/bson/-/bson-4.3.0.tgz",
+      "integrity": "sha512-LkKKeFJx5D6RRCRvLE+fDs40M2ZQNuk7W7tFXmKd7OOcQQ+BHdzCgRdL4XEGjc1UEGtiYuMvIVk91Bv8qsI50A==",
+      "requires": {
+        "buffer": "^5.6.0"
+      }
+    },
+    "buffer": {
+      "version": "5.7.1",
+      "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
+      "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
+      "requires": {
+        "base64-js": "^1.3.1",
+        "ieee754": "^1.1.13"
+      }
+    },
+    "buffer-equal-constant-time": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
+      "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk="
+    },
+    "buffer-from": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
+      "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
+    },
+    "call-bind": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
+      "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
+      "requires": {
+        "function-bind": "^1.1.1",
+        "get-intrinsic": "^1.0.2"
+      }
+    },
+    "caseless": {
+      "version": "0.12.0",
+      "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
+      "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
+    },
+    "clone": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
+      "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18="
+    },
+    "combined-stream": {
+      "version": "1.0.8",
+      "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
+      "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+      "requires": {
+        "delayed-stream": "~1.0.0"
+      }
+    },
+    "core-util-is": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
+      "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
+    },
+    "dashdash": {
+      "version": "1.14.1",
+      "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
+      "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
+      "requires": {
+        "assert-plus": "^1.0.0"
+      }
+    },
+    "debug": {
+      "version": "4.3.1",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+      "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+      "requires": {
+        "ms": "2.1.2"
+      }
+    },
+    "delayed-stream": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
+      "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
+    },
+    "depd": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
+      "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
+    },
+    "diff": {
+      "version": "4.0.2",
+      "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
+      "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A=="
+    },
+    "ecc-jsbn": {
+      "version": "0.1.2",
+      "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
+      "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
+      "requires": {
+        "jsbn": "~0.1.0",
+        "safer-buffer": "^2.1.0"
+      }
+    },
+    "ecdsa-sig-formatter": {
+      "version": "1.0.11",
+      "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",
+      "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==",
+      "requires": {
+        "safe-buffer": "^5.0.1"
+      }
+    },
+    "extend": {
+      "version": "3.0.2",
+      "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
+      "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
+    },
+    "extsprintf": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
+      "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
+    },
+    "fast-deep-equal": {
+      "version": "3.1.3",
+      "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+      "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
+    },
+    "fast-json-stable-stringify": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
+      "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
+    },
+    "forever-agent": {
+      "version": "0.6.1",
+      "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
+      "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
+    },
+    "form-data": {
+      "version": "2.3.3",
+      "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz",
+      "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==",
+      "requires": {
+        "asynckit": "^0.4.0",
+        "combined-stream": "^1.0.6",
+        "mime-types": "^2.1.12"
+      }
+    },
+    "function-bind": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
+      "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
+    },
+    "get-intrinsic": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz",
+      "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==",
+      "requires": {
+        "function-bind": "^1.1.1",
+        "has": "^1.0.3",
+        "has-symbols": "^1.0.1"
+      }
+    },
+    "getpass": {
+      "version": "0.1.7",
+      "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
+      "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
+      "requires": {
+        "assert-plus": "^1.0.0"
+      }
+    },
+    "har-schema": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
+      "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI="
+    },
+    "har-validator": {
+      "version": "5.1.5",
+      "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz",
+      "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==",
+      "requires": {
+        "ajv": "^6.12.3",
+        "har-schema": "^2.0.0"
+      }
+    },
+    "has": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
+      "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
+      "requires": {
+        "function-bind": "^1.1.1"
+      }
+    },
+    "has-symbols": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz",
+      "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw=="
+    },
+    "http-signature": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
+      "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
+      "requires": {
+        "assert-plus": "^1.0.0",
+        "jsprim": "^1.2.2",
+        "sshpk": "^1.7.0"
+      }
+    },
+    "humanize-ms": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz",
+      "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=",
+      "requires": {
+        "ms": "^2.0.0"
+      }
+    },
+    "ieee754": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
+      "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="
+    },
+    "is-regex": {
+      "version": "1.1.3",
+      "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz",
+      "integrity": "sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==",
+      "requires": {
+        "call-bind": "^1.0.2",
+        "has-symbols": "^1.0.2"
+      }
+    },
+    "is-stream": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz",
+      "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw=="
+    },
+    "is-typedarray": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
+      "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
+    },
+    "isstream": {
+      "version": "0.1.2",
+      "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
+      "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
+    },
+    "jsbn": {
+      "version": "0.1.1",
+      "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
+      "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM="
+    },
+    "json-schema": {
+      "version": "0.2.3",
+      "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
+      "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
+    },
+    "json-schema-traverse": {
+      "version": "0.4.1",
+      "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+      "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
+    },
+    "json-stringify-safe": {
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
+      "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
+    },
+    "jsonwebtoken": {
+      "version": "8.5.1",
+      "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz",
+      "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==",
+      "requires": {
+        "jws": "^3.2.2",
+        "lodash.includes": "^4.3.0",
+        "lodash.isboolean": "^3.0.3",
+        "lodash.isinteger": "^4.0.4",
+        "lodash.isnumber": "^3.0.3",
+        "lodash.isplainobject": "^4.0.6",
+        "lodash.isstring": "^4.0.1",
+        "lodash.once": "^4.0.0",
+        "ms": "^2.1.1",
+        "semver": "^5.6.0"
+      }
+    },
+    "jsprim": {
+      "version": "1.4.1",
+      "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
+      "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
+      "requires": {
+        "assert-plus": "1.0.0",
+        "extsprintf": "1.3.0",
+        "json-schema": "0.2.3",
+        "verror": "1.10.0"
+      }
+    },
+    "jwa": {
+      "version": "1.4.1",
+      "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz",
+      "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==",
+      "requires": {
+        "buffer-equal-constant-time": "1.0.1",
+        "ecdsa-sig-formatter": "1.0.11",
+        "safe-buffer": "^5.0.1"
+      }
+    },
+    "jws": {
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz",
+      "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==",
+      "requires": {
+        "jwa": "^1.4.1",
+        "safe-buffer": "^5.0.1"
+      }
+    },
+    "lodash": {
+      "version": "4.17.21",
+      "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
+      "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
+    },
+    "lodash.clonedeep": {
+      "version": "4.5.0",
+      "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
+      "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8="
+    },
+    "lodash.includes": {
+      "version": "4.3.0",
+      "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz",
+      "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8="
+    },
+    "lodash.isboolean": {
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz",
+      "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY="
+    },
+    "lodash.isinteger": {
+      "version": "4.0.4",
+      "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz",
+      "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M="
+    },
+    "lodash.isnumber": {
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz",
+      "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w="
+    },
+    "lodash.isplainobject": {
+      "version": "4.0.6",
+      "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
+      "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs="
+    },
+    "lodash.isstring": {
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz",
+      "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE="
+    },
+    "lodash.merge": {
+      "version": "4.6.2",
+      "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
+      "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ=="
+    },
+    "lodash.once": {
+      "version": "4.1.1",
+      "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz",
+      "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w="
+    },
+    "lodash.set": {
+      "version": "4.3.2",
+      "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz",
+      "integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM="
+    },
+    "lodash.unset": {
+      "version": "4.5.2",
+      "resolved": "https://registry.npmjs.org/lodash.unset/-/lodash.unset-4.5.2.tgz",
+      "integrity": "sha1-Nw0dPoW3Kn4bDN8tJyEhMG8j5O0="
+    },
+    "long": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
+      "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA=="
+    },
+    "make-error": {
+      "version": "1.3.6",
+      "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
+      "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw=="
+    },
+    "mime-db": {
+      "version": "1.47.0",
+      "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz",
+      "integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw=="
+    },
+    "mime-types": {
+      "version": "2.1.30",
+      "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz",
+      "integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==",
+      "requires": {
+        "mime-db": "1.47.0"
+      }
+    },
+    "ms": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+      "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
+    },
+    "oauth-sign": {
+      "version": "0.9.0",
+      "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
+      "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
+    },
+    "performance-now": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
+      "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
+    },
+    "protobufjs": {
+      "version": "6.8.8",
+      "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.8.tgz",
+      "integrity": "sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==",
+      "requires": {
+        "@protobufjs/aspromise": "^1.1.2",
+        "@protobufjs/base64": "^1.1.2",
+        "@protobufjs/codegen": "^2.0.4",
+        "@protobufjs/eventemitter": "^1.1.0",
+        "@protobufjs/fetch": "^1.1.0",
+        "@protobufjs/float": "^1.0.2",
+        "@protobufjs/inquire": "^1.1.0",
+        "@protobufjs/path": "^1.1.2",
+        "@protobufjs/pool": "^1.1.0",
+        "@protobufjs/utf8": "^1.1.0",
+        "@types/long": "^4.0.0",
+        "@types/node": "^10.1.0",
+        "long": "^4.0.0"
+      }
+    },
+    "psl": {
+      "version": "1.8.0",
+      "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz",
+      "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ=="
+    },
+    "punycode": {
+      "version": "1.3.2",
+      "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz",
+      "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0="
+    },
+    "qs": {
+      "version": "6.5.2",
+      "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
+      "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
+    },
+    "querystring": {
+      "version": "0.2.0",
+      "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz",
+      "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA="
+    },
+    "request": {
+      "version": "2.88.2",
+      "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz",
+      "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==",
+      "requires": {
+        "aws-sign2": "~0.7.0",
+        "aws4": "^1.8.0",
+        "caseless": "~0.12.0",
+        "combined-stream": "~1.0.6",
+        "extend": "~3.0.2",
+        "forever-agent": "~0.6.1",
+        "form-data": "~2.3.2",
+        "har-validator": "~5.1.3",
+        "http-signature": "~1.2.0",
+        "is-typedarray": "~1.0.0",
+        "isstream": "~0.1.2",
+        "json-stringify-safe": "~5.0.1",
+        "mime-types": "~2.1.19",
+        "oauth-sign": "~0.9.0",
+        "performance-now": "^2.1.0",
+        "qs": "~6.5.2",
+        "safe-buffer": "^5.1.2",
+        "tough-cookie": "~2.5.0",
+        "tunnel-agent": "^0.6.0",
+        "uuid": "^3.3.2"
+      }
+    },
+    "request-promise": {
+      "version": "4.2.6",
+      "resolved": "https://registry.npmjs.org/request-promise/-/request-promise-4.2.6.tgz",
+      "integrity": "sha512-HCHI3DJJUakkOr8fNoCc73E5nU5bqITjOYFMDrKHYOXWXrgD/SBaC7LjwuPymUprRyuF06UK7hd/lMHkmUXglQ==",
+      "requires": {
+        "bluebird": "^3.5.0",
+        "request-promise-core": "1.1.4",
+        "stealthy-require": "^1.1.1",
+        "tough-cookie": "^2.3.3"
+      }
+    },
+    "request-promise-core": {
+      "version": "1.1.4",
+      "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz",
+      "integrity": "sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==",
+      "requires": {
+        "lodash": "^4.17.19"
+      }
+    },
+    "retry": {
+      "version": "0.12.0",
+      "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz",
+      "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs="
+    },
+    "safe-buffer": {
+      "version": "5.2.1",
+      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+      "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
+    },
+    "safer-buffer": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
+      "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
+    },
+    "sax": {
+      "version": "1.2.4",
+      "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
+      "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
+    },
+    "semver": {
+      "version": "5.7.1",
+      "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+      "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
+    },
+    "source-map": {
+      "version": "0.6.1",
+      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
+    },
+    "source-map-support": {
+      "version": "0.5.19",
+      "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz",
+      "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
+      "requires": {
+        "buffer-from": "^1.0.0",
+        "source-map": "^0.6.0"
+      }
+    },
+    "sshpk": {
+      "version": "1.16.1",
+      "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz",
+      "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==",
+      "requires": {
+        "asn1": "~0.2.3",
+        "assert-plus": "^1.0.0",
+        "bcrypt-pbkdf": "^1.0.0",
+        "dashdash": "^1.12.0",
+        "ecc-jsbn": "~0.1.1",
+        "getpass": "^0.1.1",
+        "jsbn": "~0.1.0",
+        "safer-buffer": "^2.0.2",
+        "tweetnacl": "~0.14.0"
+      }
+    },
+    "stealthy-require": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz",
+      "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks="
+    },
+    "tcb-admin-node": {
+      "version": "1.23.0",
+      "resolved": "https://registry.npmjs.org/tcb-admin-node/-/tcb-admin-node-1.23.0.tgz",
+      "integrity": "sha512-SAbjTqMsSi63SId1BJ4kWdyGJzhxh9Tjvy3YXxcsoaAC2PtASn4UIYsBsiNEUfcn58QEn2tdvCvvf69WLLjjrg==",
+      "requires": {
+        "@cloudbase/database": "0.9.15",
+        "@cloudbase/signature-nodejs": "^1.0.0-beta.0",
+        "is-regex": "^1.0.4",
+        "jsonwebtoken": "^8.5.1",
+        "lodash.merge": "^4.6.1",
+        "request": "^2.87.0",
+        "xml2js": "^0.4.19"
+      },
+      "dependencies": {
+        "@cloudbase/database": {
+          "version": "0.9.15",
+          "resolved": "https://registry.npmjs.org/@cloudbase/database/-/database-0.9.15.tgz",
+          "integrity": "sha512-63e7iIl+van41B39Tw4ScNe9TRCt+5GHjc7q6i8NzkWBLC3U3KlbWo79YHsUHUPI79POpQ8UMlMVo7HXIAO3dg==",
+          "requires": {
+            "bson": "^4.0.2",
+            "lodash.clonedeep": "4.5.0",
+            "lodash.set": "4.3.2",
+            "lodash.unset": "4.5.2"
+          }
+        }
+      }
+    },
+    "tough-cookie": {
+      "version": "2.5.0",
+      "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz",
+      "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==",
+      "requires": {
+        "psl": "^1.1.28",
+        "punycode": "^2.1.1"
+      },
+      "dependencies": {
+        "punycode": {
+          "version": "2.1.1",
+          "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
+          "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
+        }
+      }
+    },
+    "ts-node": {
+      "version": "8.10.2",
+      "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz",
+      "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==",
+      "requires": {
+        "arg": "^4.1.0",
+        "diff": "^4.0.1",
+        "make-error": "^1.1.1",
+        "source-map-support": "^0.5.17",
+        "yn": "3.1.1"
+      }
+    },
+    "tslib": {
+      "version": "1.14.1",
+      "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+      "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
+    },
+    "tunnel-agent": {
+      "version": "0.6.0",
+      "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
+      "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
+      "requires": {
+        "safe-buffer": "^5.0.1"
+      }
+    },
+    "tweetnacl": {
+      "version": "0.14.5",
+      "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
+      "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
+    },
+    "uri-js": {
+      "version": "4.4.1",
+      "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
+      "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
+      "requires": {
+        "punycode": "^2.1.0"
+      },
+      "dependencies": {
+        "punycode": {
+          "version": "2.1.1",
+          "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
+          "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
+        }
+      }
+    },
+    "url": {
+      "version": "0.11.0",
+      "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz",
+      "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=",
+      "requires": {
+        "punycode": "1.3.2",
+        "querystring": "0.2.0"
+      }
+    },
+    "uuid": {
+      "version": "3.4.0",
+      "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
+      "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
+    },
+    "verror": {
+      "version": "1.10.0",
+      "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
+      "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
+      "requires": {
+        "assert-plus": "^1.0.0",
+        "core-util-is": "1.0.2",
+        "extsprintf": "^1.2.0"
+      }
+    },
+    "wx-server-sdk": {
+      "version": "2.4.0",
+      "resolved": "https://registry.npmjs.org/wx-server-sdk/-/wx-server-sdk-2.4.0.tgz",
+      "integrity": "sha512-+d/OAUgt3LVlIwC/EEd9oHK2VltMqvoSa3Z797sgZ/hBm/Z+bhYBX3PfrRgn41fprzNk49jdbmw8Rkwa4JryIQ==",
+      "requires": {
+        "@cloudbase/node-sdk": "2.4.7",
+        "protobufjs": "6.8.8",
+        "tcb-admin-node": "^1.23.0",
+        "tslib": "^1.9.3"
+      }
+    },
+    "xml2js": {
+      "version": "0.4.23",
+      "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
+      "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==",
+      "requires": {
+        "sax": ">=0.6.0",
+        "xmlbuilder": "~11.0.0"
+      }
+    },
+    "xmlbuilder": {
+      "version": "11.0.1",
+      "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
+      "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA=="
+    },
+    "yn": {
+      "version": "3.1.1",
+      "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
+      "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q=="
+    }
+  }
+}

+ 81 - 0
pages/back_sand/back.js

@@ -0,0 +1,81 @@
+// pages/back/back.js
+import { APP_ID, SUB_APP_ID, APPID, SHNAME, VERSION, METHOD, PRODUCTID, ACCESSTYPE, CHANNELTYPE, NOTIFYURL, FRONTURL, CLIENTIP, CLEARCYCLE, PAYMODE, PRIVATEKEY, PUBLICKEY, USE_PRIVATEKEY } from '../../config_sand.js';
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+     id:"",
+     msg:"",
+     shname:SHNAME
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    var that = this;
+    that.setData({  id: options.id });
+    if (options.id == 1){
+      that.setData({ msg: '0000' });
+    }else{
+      that.setData({ msg: '9999' });
+    }
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    // wx.hideHomeButton()
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+  goIndex: function () {
+    wx.redirectTo({
+      url: '/pages/index/index'
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 4 - 0
pages/back_sand/back.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+ "disableSwipeBack":true
+}

+ 27 - 0
pages/back_sand/back.wxml

@@ -0,0 +1,27 @@
+<view class="page" data-weui-theme="{{theme}}">
+	<view class="page__hd">
+		<view class="page__title"></view>
+		<view class="page__desc"></view>
+	</view>
+	<view class="page__bd page__bd_spacing" wx:if="{{id == 1 }}">
+		<view class="icon-box">
+			<i class="weui-icon-success weui-icon_msg"></i>
+			<view class="icon-box__ctn">
+				<h3 class="icon-box__title">支付成功</h3>
+				<!-- <view class="icon-box__desc">欢迎使用{{shname}}</view> -->
+			</view>
+		</view>
+	</view>
+  <view class="page__bd page__bd_spacing" wx:if="{{id == 2 }}">
+		<view class="icon-box">
+			<i class="weui-icon-warn weui-icon_msg"></i>
+			<view class="icon-box__ctn">
+				<h3 class="icon-box__title">支付失败</h3>
+				<!-- <view class="icon-box__desc">欢迎使用{{shname}}</view> -->
+			</view>
+		</view>
+	</view>
+</view>
+  <button class="weui-btn" type="primary" open-type="launchApp" app-parameter="{{msg}}" binderror="launchAppError" >返回商家</button>
+
+

Разница между файлами не показана из-за своего большого размера
+ 7 - 0
pages/back_sand/back.wxss


+ 24 - 0
pages/index/index.js

@@ -0,0 +1,24 @@
+//index.js
+//获取应用实例
+import { APPID,URL } from '../../config_sand.js';
+Page({
+  data: {
+    url: 'https://mxpay.mixienet.com.cn/index/'+APPID
+    // url: wx.getExtConfigSync().URL + APPID
+  },
+  onShow: function () {
+    // wx.hideHomeButton()
+    let extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}
+    wx.login({
+      success (res) {
+        if (res.code) {
+          //发起网络请求
+          console.log('res.code',res.code)
+        } else {
+          console.log('登录失败!' + res.errMsg)
+        }
+      }
+    })
+    console.log('extConfig',wx.getExtConfigSync())
+  },
+})

+ 3 - 0
pages/index/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 34 - 0
pages/index/index.wxml

@@ -0,0 +1,34 @@
+
+<view class='product-bg'>
+        <swiper  indicator-dots="{{indicatorDots}}"
+            autoplay="{{autoplay}}" circular="{{circular}}" interval="{{interval}}" duration="{{duration}}" bindchange="change">
+           
+              <swiper-item>
+                <image  mode="aspectFill" src="/image/index-banner.png" class="slide-image"/>
+              </swiper-item>
+           
+        </swiper>
+         <view class="mylogog">
+          <image src="/image/logo.jpg" class='mylogo' mode="aspectFill"></image>
+         </view>
+          <view class="sss">声擎未来</view>
+          <view class="ssss">声擎未来(武汉)科技有限公司</view>
+         <view class="mgfirst">
+         <view class="mgtext">联系我们</view>
+         </view>
+         <view class="divLine"></view>  
+          <view class="mg">
+         <view class="mgtext">联系地址: 湖北省武汉市汉阳区四新北路328号鲤鱼洲家园商业公寓楼35栋4层42室</view>
+         </view>
+          <view class="mg">
+         <view class="mgtext">客服电话: 18446403886</view>
+         </view>
+          <view class="mg">
+         <view class="mgtext">邮箱地址: hechao@gbyy91.com</view>
+         </view>
+          <view class="mg">
+         <view class="mgtext">微信公众号: gbyy91</view>
+         </view>
+</view>
+
+ <!-- <web-view src="{{url}}"></web-view> -->

+ 67 - 0
pages/index/index.wxss

@@ -0,0 +1,67 @@
+/**index.wxss**/
+.userinfo {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+.product-bg{width:100%;height:300rpx;position:absolute;}
+.product-bg swiper{width:100%;height:300rpx;position:relative;}
+.product-bg .slide-image{width:100%;height:300rpx;}
+.product-bg .pages{position:absolute;background-color:#fff;height:34rpx;padding:0 10rpx;border-radius:3rpx;right:30rpx;bottom:30rpx;line-height:34rpx;font-size:24rpx;color:#050505;}
+.product-bg .mylogog .mylogo{
+  width: 180rpx;
+  height: 180rpx;
+  border-radius: 50%;
+}
+.product-bg .mylogog{
+  border-radius: 50%;
+  background-color:#fff;
+  position:absolute;
+  z-index: 2;
+  width: 180rpx;
+  height: 180rpx;
+  left: 285rpx;
+  top: 210rpx;
+  overflow: hidden;
+  box-shadow: 0 4rpx 8rpx rgba(0,0,0,0.1);
+}
+
+.userinfo-avatar {
+  width: 128rpx;
+  height: 128rpx;
+  margin: 20rpx;
+  border-radius: 50%;
+}
+.mg{
+  width: 90%;height:100rpx;display: flex;background-color:#f1f1f1;margin-right: 5%;margin-left: 5%;align-items: center;
+}
+.mgfirst{
+  width: 90%;height:100rpx;display: flex;background-color:#f1f1f1;margin-right: 5%;margin-left: 5%;margin-top: 60rpx;align-items: center;
+}
+.mgtext{
+  padding-left: 20rpx;
+}
+.divLine{
+ background: #aaa;margin-right: 5%;margin-left: 5%;
+ width: 90%;
+ height: 5rpx;
+}
+.userinfo-nickname {
+  color: #aaa;
+}
+
+.usermotto {
+  margin-top: 200px;
+}
+.sss{
+  font-size:40rpx;color: #1a1717;
+  position:relative;display:block;margin-left:auto;margin-right:auto;padding:50rpx 10rpx 10rpx 10rpx;text-align:center;margin-top: 30rpx;
+}
+.ssss{
+  font-size:30rpx;color: #1a1717;
+  position:relative;display:block;width:100%;margin-left:auto;margin-right:auto;text-align:center;
+}
+.weui-btn{position:relative;display:block;width:184px;margin-left:auto;margin-right:auto;padding:8px 24px;box-sizing:border-box;font-weight:700;font-size:17px;text-align:center;text-decoration:none;color:#fff;line-height:1.41176471;border-radius:4px;-webkit-tap-highlight-color:rgba(0,0,0,0);overflow:hidden}.weui-btn_block{width:auto}.weui-btn_inline{display:inline-block}
+.images{
+  width:250rpx;height:250rpx;
+}

+ 137 - 0
pages/zf/index.js

@@ -0,0 +1,137 @@
+import { APPID, USERCODE, USE_PRIVATEKEY, MYpublicKey } from '../../config_sand.js';
+import util from '../../utils_sand/util.js';
+
+Page({
+  data: {
+    wechatData: null,
+    orderNo: '',
+    msg: '',
+    sandpay: '',
+    backing: true,
+  },
+
+  onLoad(options) {
+    const { orderNo, back } = options;
+    this.setData({ orderNo: orderNo || '' });
+    if (back) this.setData({ backing: false });
+
+    // Try cached order
+    const cacheKey = `order_${orderNo}`;
+    const cached = wx.getStorageSync(cacheKey);
+    if (cached) {
+      console.log('[Cache] Found cached payment data for', orderNo, cached);
+      this.setData({ wechatData: cached });
+      this.composeAndPay();
+    } else if (orderNo) {
+      this.initiateLogin(orderNo);
+    } else {
+      util.Tips({ title: '无效的订单号' });
+    }
+  },
+
+  initiateLogin(orderNo) {
+    wx.login({
+      success: ({ code }) => this.fetchOpenId(code, orderNo),
+      fail: () => util.Tips({ title: '微信登录失败' }),
+    });
+  },
+
+  fetchOpenId(code, orderNo) {
+    if (!orderNo) return util.Tips({ title: '订单号缺失' });
+    wx.request({
+      url: `https://gbyy91.com/api/efps/wechat/miniapp/auth?code=${code}`,
+      method: 'POST',
+      success: res => {
+        const { statusCode, data } = res;
+        if (statusCode === 200 && data.success) {
+          this.createOrder(orderNo, data.openid);
+        } else {
+          util.Tips({ title: `获取OpenID失败:${data.msg || statusCode}` });
+        }
+      },
+      fail: err => util.Tips({ title: `获取OpenID错误:${err}` }),
+    });
+  },
+
+  createOrder(orderNo, openId) {
+    wx.request({
+      url: `https://gbyy91.com/api/web/wechatMiniAppPay?orderNo=${orderNo}&openId=${openId}`,
+      method: 'POST',
+      success: res => {
+        const { statusCode, data } = res;
+        if (statusCode === 200 && data.code === 200) {
+          let outputJSON;
+          try {
+            outputJSON = JSON.parse(data.data.outputJSON);
+          } catch (e) {
+            return util.Tips({ title: `解析响应失败:${data.msg}` });
+          }
+
+          const { returnCode, returnMsg } = outputJSON;
+          if (returnCode === '0000') {
+            this.cacheOrder(this.data.orderNo, outputJSON);
+            this.setData({ wechatData: outputJSON });
+            this.composeAndPay();
+          } else {
+            util.Tips({ title: `创建订单失败:${returnMsg}` });
+          }
+        } else {
+          util.Tips({ title: `下单失败:${data.msg}` });
+        }
+      },
+      fail: err => util.Tips({ title: `下单错误:${err}` }),
+    });
+  },
+
+  cacheOrder(orderNo, data) {
+    try {
+      const key = `order_${orderNo}`;
+      wx.setStorageSync(key, data);
+      console.log('[Cache] 保存订单', key, data);
+    } catch (e) {
+      console.warn('缓存订单失败', e);
+    }
+  },
+
+  clearOrderCache(orderNo) {
+    try {
+      const key = `order_${orderNo}`;
+      wx.removeStorageSync(key);
+      console.log('[Cache] 清除订单缓存', key);
+    } catch (e) {
+      console.warn('清除订单缓存失败', e);
+    }
+  },
+
+  launchAppError(e) {
+    wx.showToast({ title: '跳回 App 失败', icon: 'none' });
+  },
+
+  composeAndPay() {
+    const payData = this.data.wechatData.wxJsapiParam;
+    if (!payData) return util.Tips({ title: '支付参数缺失' });
+
+    wx.showLoading({ title: '加载中' });
+    wx.hideLoading();
+    try {
+      wx.requestPayment({
+        timeStamp: payData.timeStamp,
+        nonceStr: payData.nonceStr,
+        package: payData.package,
+        signType: payData.signType,
+        paySign: payData.paySign,
+        success: () => {
+          this.setData({ msg: '0000', back: true, sandpay: 'success' });
+          this.clearOrderCache(this.data.orderNo);
+        },
+        fail: err => {
+          console.error('支付失败', err);
+          this.setData({ msg: '9999', back: true, sandpay: 'fail' });
+        },
+        complete: () => {},
+      });
+    } catch {
+      this.setData({ msg: redirectUrl, sandpay: 'fail' });
+    }
+  },
+});

+ 9 - 0
pages/zf/index.json

@@ -0,0 +1,9 @@
+{
+  "usingComponents": {
+    
+  },
+  "navigationBarTitleText": "确认交易",
+  "navigationBarBackgroundColor": "#000",
+  "navigationBarTextStyle": "white",
+  "disableScroll": true
+}

+ 29 - 0
pages/zf/index.wxml

@@ -0,0 +1,29 @@
+<view class="fadeIn" wx:if="{{sandpay=='fail'}}">
+        <view class="weui-mask"></view>
+        <view class="weui-dialog">
+            <view class="weui-dialog__hd"><strong class="weui-dialog__title">支付失败请选择</strong></view>
+            <!-- <view class="weui-dialog__bd">弹窗内容,告知当前状态、信息和解决方法,描述文字尽量控制在三行内</view> -->
+            <view class="weui-dialog__ft" >
+                <a class="weui-dialog__btn weui-dialog__btn_default"  wx:if="{{msg == '9999'}}" bindtap="composeAndPay">继续支付</a>
+                <a class="weui-dialog__btn weui-dialog__btn_primary "  wx:if="{{back}}">
+                <!-- <button  class='btn' open-type="launchApp"  app-parameter="{{msg}}" binderror="launchAppError"></button> -->
+                <button  class='btn' open-type="launchApp" app-parameter="{{wechatData.redirectUrl}}" binderror="launchAppError">返回APP</button>
+                 <!-- <navigator open-type="exit" target="miniProgram">
+                 <button  class='btn' open-type="launchApp"  app-parameter="{{msg}}" binderror="launchAppError">关闭</button></navigator> -->
+                 </a>
+            </view>
+        </view>
+</view>
+  <view class="fadeIn" wx:if="{{sandpay=='success'}}">
+        <view class="weui-mask"></view>
+        <view class="weui-dialog">
+            <view class="weui-dialog__bd">支付成功</view>
+            <view class="weui-dialog__ft" wx:if="{{back}}">
+                <a class="weui-dialog__btn weui-dialog__btn_primary"  >
+                <!-- <button  class='btn' open-type="launchApp"  app-parameter="{{msg}}" binderror="launchAppError"></button>           -->
+                <!-- <navigator open-type="exit" target="miniProgram"> <button  class='btn' open-type="launchApp"  app-parameter="{{msg}}" binderror="launchAppError">关闭</button> </navigator>               -->
+                <button  class='btn' open-type="launchApp" app-parameter="{{wechatData.redirectUrl}}" binderror="launchAppError">返回APP</button>
+                </a>
+            </view>
+        </view>
+    </view>

Разница между файлами не показана из-за своего большого размера
+ 8 - 0
pages/zf/index.wxss


Разница между файлами не показана из-за своего большого размера
+ 100 - 0
project.config.json


+ 44 - 0
project.private.config.json

@@ -0,0 +1,44 @@
+{
+  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+  "setting": {
+    "urlCheck": false,
+    "compileHotReLoad": true,
+    "coverView": true,
+    "lazyloadPlaceholderEnable": false,
+    "skylineRenderEnable": false,
+    "preloadBackgroundData": false,
+    "autoAudits": false,
+    "useApiHook": true,
+    "useApiHostProcess": true,
+    "showShadowRootInWxmlPanel": true,
+    "useStaticServer": false,
+    "useLanDebug": false,
+    "showES6CompileOption": false,
+    "checkInvalidKey": true,
+    "ignoreDevUnusedFiles": true,
+    "bigPackageSizeSupport": false,
+    "useIsolateContext": false
+  },
+  "condition": {
+    "miniprogram": {
+      "list": [
+        {
+          "name": "pages/zf/index",
+          "pathName": "pages/zf/index",
+          "query": "orderNo=1136771751015669719",
+          "scene": null,
+          "launchMode": "default"
+        },
+        {
+          "name": "pages/zf/index",
+          "pathName": "pages/zf/index",
+          "query": "orderNo=1141431750957944924",
+          "launchMode": "default",
+          "scene": null
+        }
+      ]
+    }
+  },
+  "projectname": "%E5%85%A8%E6%94%AF%E4%BB%98%E6%94%B6%E9%93%B6%E5%8F%B0",
+  "libVersion": "3.8.9"
+}

+ 7 - 0
sitemap.json

@@ -0,0 +1,7 @@
+{
+  "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
+  "rules": [{
+  "action": "allow",
+  "page": "*"
+  }]
+}

+ 175 - 0
utils_sand/aes.js

@@ -0,0 +1,175 @@
+/*
+CryptoJS v3.1.2
+code.google.com/p/crypto-js
+(c) 2009-2013 by Jeff Mott. All rights reserved.
+code.google.com/p/crypto-js/wiki/License
+*/
+var CryptoJS = CryptoJS || function (u, p) {
+    var d = {}, l = d.lib = {}, s = function () { }, t = l.Base = { extend: function (a) { s.prototype = this; var c = new s; a && c.mixIn(a); c.hasOwnProperty("init") || (c.init = function () { c.$super.init.apply(this, arguments) }); c.init.prototype = c; c.$super = this; return c }, create: function () { var a = this.extend(); a.init.apply(a, arguments); return a }, init: function () { }, mixIn: function (a) { for (var c in a) a.hasOwnProperty(c) && (this[c] = a[c]); a.hasOwnProperty("toString") && (this.toString = a.toString) }, clone: function () { return this.init.prototype.extend(this) } },
+    r = l.WordArray = t.extend({
+      init: function (a, c) { a = this.words = a || []; this.sigBytes = c != p ? c : 4 * a.length }, toString: function (a) { return (a || v).stringify(this) }, concat: function (a) { var c = this.words, e = a.words, j = this.sigBytes; a = a.sigBytes; this.clamp(); if (j % 4) for (var k = 0; k < a; k++)c[j + k >>> 2] |= (e[k >>> 2] >>> 24 - 8 * (k % 4) & 255) << 24 - 8 * ((j + k) % 4); else if (65535 < e.length) for (k = 0; k < a; k += 4)c[j + k >>> 2] = e[k >>> 2]; else c.push.apply(c, e); this.sigBytes += a; return this }, clamp: function () {
+        var a = this.words, c = this.sigBytes; a[c >>> 2] &= 4294967295 <<
+          32 - 8 * (c % 4); a.length = u.ceil(c / 4)
+      }, clone: function () { var a = t.clone.call(this); a.words = this.words.slice(0); return a }, random: function (a) { for (var c = [], e = 0; e < a; e += 4)c.push(4294967296 * u.random() | 0); return new r.init(c, a) }
+    }), w = d.enc = {}, v = w.Hex = {
+      stringify: function (a) { var c = a.words; a = a.sigBytes; for (var e = [], j = 0; j < a; j++) { var k = c[j >>> 2] >>> 24 - 8 * (j % 4) & 255; e.push((k >>> 4).toString(16)); e.push((k & 15).toString(16)) } return e.join("") }, parse: function (a) {
+        for (var c = a.length, e = [], j = 0; j < c; j += 2)e[j >>> 3] |= parseInt(a.substr(j,
+          2), 16) << 24 - 4 * (j % 8); return new r.init(e, c / 2)
+      }
+    }, b = w.Latin1 = { stringify: function (a) { var c = a.words; a = a.sigBytes; for (var e = [], j = 0; j < a; j++)e.push(String.fromCharCode(c[j >>> 2] >>> 24 - 8 * (j % 4) & 255)); return e.join("") }, parse: function (a) { for (var c = a.length, e = [], j = 0; j < c; j++)e[j >>> 2] |= (a.charCodeAt(j) & 255) << 24 - 8 * (j % 4); return new r.init(e, c) } }, x = w.Utf8 = { stringify: function (a) { try { return decodeURIComponent(escape(b.stringify(a))) } catch (c) { throw Error("Malformed UTF-8 data"); } }, parse: function (a) { return b.parse(unescape(encodeURIComponent(a))) } },
+    q = l.BufferedBlockAlgorithm = t.extend({
+      reset: function () { this._data = new r.init; this._nDataBytes = 0 }, _append: function (a) { "string" == typeof a && (a = x.parse(a)); this._data.concat(a); this._nDataBytes += a.sigBytes }, _process: function (a) { var c = this._data, e = c.words, j = c.sigBytes, k = this.blockSize, b = j / (4 * k), b = a ? u.ceil(b) : u.max((b | 0) - this._minBufferSize, 0); a = b * k; j = u.min(4 * a, j); if (a) { for (var q = 0; q < a; q += k)this._doProcessBlock(e, q); q = e.splice(0, a); c.sigBytes -= j } return new r.init(q, j) }, clone: function () {
+        var a = t.clone.call(this);
+        a._data = this._data.clone(); return a
+      }, _minBufferSize: 0
+    }); l.Hasher = q.extend({
+      cfg: t.extend(), init: function (a) { this.cfg = this.cfg.extend(a); this.reset() }, reset: function () { q.reset.call(this); this._doReset() }, update: function (a) { this._append(a); this._process(); return this }, finalize: function (a) { a && this._append(a); return this._doFinalize() }, blockSize: 16, _createHelper: function (a) { return function (b, e) { return (new a.init(e)).finalize(b) } }, _createHmacHelper: function (a) {
+        return function (b, e) {
+          return (new n.HMAC.init(a,
+            e)).finalize(b)
+        }
+      }
+    }); var n = d.algo = {}; return d
+  }(Math);
+  (function () {
+    var u = CryptoJS, p = u.lib.WordArray; u.enc.Base64 = {
+      stringify: function (d) { var l = d.words, p = d.sigBytes, t = this._map; d.clamp(); d = []; for (var r = 0; r < p; r += 3)for (var w = (l[r >>> 2] >>> 24 - 8 * (r % 4) & 255) << 16 | (l[r + 1 >>> 2] >>> 24 - 8 * ((r + 1) % 4) & 255) << 8 | l[r + 2 >>> 2] >>> 24 - 8 * ((r + 2) % 4) & 255, v = 0; 4 > v && r + 0.75 * v < p; v++)d.push(t.charAt(w >>> 6 * (3 - v) & 63)); if (l = t.charAt(64)) for (; d.length % 4;)d.push(l); return d.join("") }, parse: function (d) {
+        var l = d.length, s = this._map, t = s.charAt(64); t && (t = d.indexOf(t), -1 != t && (l = t)); for (var t = [], r = 0, w = 0; w <
+          l; w++)if (w % 4) { var v = s.indexOf(d.charAt(w - 1)) << 2 * (w % 4), b = s.indexOf(d.charAt(w)) >>> 6 - 2 * (w % 4); t[r >>> 2] |= (v | b) << 24 - 8 * (r % 4); r++ } return p.create(t, r)
+      }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
+    }
+  })();
+  (function (u) {
+    function p(b, n, a, c, e, j, k) { b = b + (n & a | ~n & c) + e + k; return (b << j | b >>> 32 - j) + n } function d(b, n, a, c, e, j, k) { b = b + (n & c | a & ~c) + e + k; return (b << j | b >>> 32 - j) + n } function l(b, n, a, c, e, j, k) { b = b + (n ^ a ^ c) + e + k; return (b << j | b >>> 32 - j) + n } function s(b, n, a, c, e, j, k) { b = b + (a ^ (n | ~c)) + e + k; return (b << j | b >>> 32 - j) + n } for (var t = CryptoJS, r = t.lib, w = r.WordArray, v = r.Hasher, r = t.algo, b = [], x = 0; 64 > x; x++)b[x] = 4294967296 * u.abs(u.sin(x + 1)) | 0; r = r.MD5 = v.extend({
+      _doReset: function () { this._hash = new w.init([1732584193, 4023233417, 2562383102, 271733878]) },
+      _doProcessBlock: function (q, n) {
+        for (var a = 0; 16 > a; a++) { var c = n + a, e = q[c]; q[c] = (e << 8 | e >>> 24) & 16711935 | (e << 24 | e >>> 8) & 4278255360 } var a = this._hash.words, c = q[n + 0], e = q[n + 1], j = q[n + 2], k = q[n + 3], z = q[n + 4], r = q[n + 5], t = q[n + 6], w = q[n + 7], v = q[n + 8], A = q[n + 9], B = q[n + 10], C = q[n + 11], u = q[n + 12], D = q[n + 13], E = q[n + 14], x = q[n + 15], f = a[0], m = a[1], g = a[2], h = a[3], f = p(f, m, g, h, c, 7, b[0]), h = p(h, f, m, g, e, 12, b[1]), g = p(g, h, f, m, j, 17, b[2]), m = p(m, g, h, f, k, 22, b[3]), f = p(f, m, g, h, z, 7, b[4]), h = p(h, f, m, g, r, 12, b[5]), g = p(g, h, f, m, t, 17, b[6]), m = p(m, g, h, f, w, 22, b[7]),
+          f = p(f, m, g, h, v, 7, b[8]), h = p(h, f, m, g, A, 12, b[9]), g = p(g, h, f, m, B, 17, b[10]), m = p(m, g, h, f, C, 22, b[11]), f = p(f, m, g, h, u, 7, b[12]), h = p(h, f, m, g, D, 12, b[13]), g = p(g, h, f, m, E, 17, b[14]), m = p(m, g, h, f, x, 22, b[15]), f = d(f, m, g, h, e, 5, b[16]), h = d(h, f, m, g, t, 9, b[17]), g = d(g, h, f, m, C, 14, b[18]), m = d(m, g, h, f, c, 20, b[19]), f = d(f, m, g, h, r, 5, b[20]), h = d(h, f, m, g, B, 9, b[21]), g = d(g, h, f, m, x, 14, b[22]), m = d(m, g, h, f, z, 20, b[23]), f = d(f, m, g, h, A, 5, b[24]), h = d(h, f, m, g, E, 9, b[25]), g = d(g, h, f, m, k, 14, b[26]), m = d(m, g, h, f, v, 20, b[27]), f = d(f, m, g, h, D, 5, b[28]), h = d(h, f,
+            m, g, j, 9, b[29]), g = d(g, h, f, m, w, 14, b[30]), m = d(m, g, h, f, u, 20, b[31]), f = l(f, m, g, h, r, 4, b[32]), h = l(h, f, m, g, v, 11, b[33]), g = l(g, h, f, m, C, 16, b[34]), m = l(m, g, h, f, E, 23, b[35]), f = l(f, m, g, h, e, 4, b[36]), h = l(h, f, m, g, z, 11, b[37]), g = l(g, h, f, m, w, 16, b[38]), m = l(m, g, h, f, B, 23, b[39]), f = l(f, m, g, h, D, 4, b[40]), h = l(h, f, m, g, c, 11, b[41]), g = l(g, h, f, m, k, 16, b[42]), m = l(m, g, h, f, t, 23, b[43]), f = l(f, m, g, h, A, 4, b[44]), h = l(h, f, m, g, u, 11, b[45]), g = l(g, h, f, m, x, 16, b[46]), m = l(m, g, h, f, j, 23, b[47]), f = s(f, m, g, h, c, 6, b[48]), h = s(h, f, m, g, w, 10, b[49]), g = s(g, h, f, m,
+              E, 15, b[50]), m = s(m, g, h, f, r, 21, b[51]), f = s(f, m, g, h, u, 6, b[52]), h = s(h, f, m, g, k, 10, b[53]), g = s(g, h, f, m, B, 15, b[54]), m = s(m, g, h, f, e, 21, b[55]), f = s(f, m, g, h, v, 6, b[56]), h = s(h, f, m, g, x, 10, b[57]), g = s(g, h, f, m, t, 15, b[58]), m = s(m, g, h, f, D, 21, b[59]), f = s(f, m, g, h, z, 6, b[60]), h = s(h, f, m, g, C, 10, b[61]), g = s(g, h, f, m, j, 15, b[62]), m = s(m, g, h, f, A, 21, b[63]); a[0] = a[0] + f | 0; a[1] = a[1] + m | 0; a[2] = a[2] + g | 0; a[3] = a[3] + h | 0
+      }, _doFinalize: function () {
+        var b = this._data, n = b.words, a = 8 * this._nDataBytes, c = 8 * b.sigBytes; n[c >>> 5] |= 128 << 24 - c % 32; var e = u.floor(a /
+          4294967296); n[(c + 64 >>> 9 << 4) + 15] = (e << 8 | e >>> 24) & 16711935 | (e << 24 | e >>> 8) & 4278255360; n[(c + 64 >>> 9 << 4) + 14] = (a << 8 | a >>> 24) & 16711935 | (a << 24 | a >>> 8) & 4278255360; b.sigBytes = 4 * (n.length + 1); this._process(); b = this._hash; n = b.words; for (a = 0; 4 > a; a++)c = n[a], n[a] = (c << 8 | c >>> 24) & 16711935 | (c << 24 | c >>> 8) & 4278255360; return b
+      }, clone: function () { var b = v.clone.call(this); b._hash = this._hash.clone(); return b }
+    }); t.MD5 = v._createHelper(r); t.HmacMD5 = v._createHmacHelper(r)
+  })(Math);
+  (function () {
+    var u = CryptoJS, p = u.lib, d = p.Base, l = p.WordArray, p = u.algo, s = p.EvpKDF = d.extend({ cfg: d.extend({ keySize: 4, hasher: p.MD5, iterations: 1 }), init: function (d) { this.cfg = this.cfg.extend(d) }, compute: function (d, r) { for (var p = this.cfg, s = p.hasher.create(), b = l.create(), u = b.words, q = p.keySize, p = p.iterations; u.length < q;) { n && s.update(n); var n = s.update(d).finalize(r); s.reset(); for (var a = 1; a < p; a++)n = s.finalize(n), s.reset(); b.concat(n) } b.sigBytes = 4 * q; return b } }); u.EvpKDF = function (d, l, p) {
+      return s.create(p).compute(d,
+        l)
+    }
+  })();
+  CryptoJS.lib.Cipher || function (u) {
+    var p = CryptoJS, d = p.lib, l = d.Base, s = d.WordArray, t = d.BufferedBlockAlgorithm, r = p.enc.Base64, w = p.algo.EvpKDF, v = d.Cipher = t.extend({
+      cfg: l.extend(), createEncryptor: function (e, a) { return this.create(this._ENC_XFORM_MODE, e, a) }, createDecryptor: function (e, a) { return this.create(this._DEC_XFORM_MODE, e, a) }, init: function (e, a, b) { this.cfg = this.cfg.extend(b); this._xformMode = e; this._key = a; this.reset() }, reset: function () { t.reset.call(this); this._doReset() }, process: function (e) { this._append(e); return this._process() },
+      finalize: function (e) { e && this._append(e); return this._doFinalize() }, keySize: 4, ivSize: 4, _ENC_XFORM_MODE: 1, _DEC_XFORM_MODE: 2, _createHelper: function (e) { return { encrypt: function (b, k, d) { return ("string" == typeof k ? c : a).encrypt(e, b, k, d) }, decrypt: function (b, k, d) { return ("string" == typeof k ? c : a).decrypt(e, b, k, d) } } }
+    }); d.StreamCipher = v.extend({ _doFinalize: function () { return this._process(!0) }, blockSize: 1 }); var b = p.mode = {}, x = function (e, a, b) {
+      var c = this._iv; c ? this._iv = u : c = this._prevBlock; for (var d = 0; d < b; d++)e[a + d] ^=
+        c[d]
+    }, q = (d.BlockCipherMode = l.extend({ createEncryptor: function (e, a) { return this.Encryptor.create(e, a) }, createDecryptor: function (e, a) { return this.Decryptor.create(e, a) }, init: function (e, a) { this._cipher = e; this._iv = a } })).extend(); q.Encryptor = q.extend({ processBlock: function (e, a) { var b = this._cipher, c = b.blockSize; x.call(this, e, a, c); b.encryptBlock(e, a); this._prevBlock = e.slice(a, a + c) } }); q.Decryptor = q.extend({
+      processBlock: function (e, a) {
+        var b = this._cipher, c = b.blockSize, d = e.slice(a, a + c); b.decryptBlock(e, a); x.call(this,
+          e, a, c); this._prevBlock = d
+      }
+    }); b = b.CBC = q; q = (p.pad = {}).Pkcs7 = { pad: function (a, b) { for (var c = 4 * b, c = c - a.sigBytes % c, d = c << 24 | c << 16 | c << 8 | c, l = [], n = 0; n < c; n += 4)l.push(d); c = s.create(l, c); a.concat(c) }, unpad: function (a) { a.sigBytes -= a.words[a.sigBytes - 1 >>> 2] & 255 } }; d.BlockCipher = v.extend({
+      cfg: v.cfg.extend({ mode: b, padding: q }), reset: function () {
+        v.reset.call(this); var a = this.cfg, b = a.iv, a = a.mode; if (this._xformMode == this._ENC_XFORM_MODE) var c = a.createEncryptor; else c = a.createDecryptor, this._minBufferSize = 1; this._mode = c.call(a,
+          this, b && b.words)
+      }, _doProcessBlock: function (a, b) { this._mode.processBlock(a, b) }, _doFinalize: function () { var a = this.cfg.padding; if (this._xformMode == this._ENC_XFORM_MODE) { a.pad(this._data, this.blockSize); var b = this._process(!0) } else b = this._process(!0), a.unpad(b); return b }, blockSize: 4
+    }); var n = d.CipherParams = l.extend({ init: function (a) { this.mixIn(a) }, toString: function (a) { return (a || this.formatter).stringify(this) } }), b = (p.format = {}).OpenSSL = {
+      stringify: function (a) {
+        var b = a.ciphertext; a = a.salt; return (a ? s.create([1398893684,
+          1701076831]).concat(a).concat(b) : b).toString(r)
+      }, parse: function (a) { a = r.parse(a); var b = a.words; if (1398893684 == b[0] && 1701076831 == b[1]) { var c = s.create(b.slice(2, 4)); b.splice(0, 4); a.sigBytes -= 16 } return n.create({ ciphertext: a, salt: c }) }
+    }, a = d.SerializableCipher = l.extend({
+      cfg: l.extend({ format: b }), encrypt: function (a, b, c, d) { d = this.cfg.extend(d); var l = a.createEncryptor(c, d); b = l.finalize(b); l = l.cfg; return n.create({ ciphertext: b, key: c, iv: l.iv, algorithm: a, mode: l.mode, padding: l.padding, blockSize: a.blockSize, formatter: d.format }) },
+      decrypt: function (a, b, c, d) { d = this.cfg.extend(d); b = this._parse(b, d.format); return a.createDecryptor(c, d).finalize(b.ciphertext) }, _parse: function (a, b) { return "string" == typeof a ? b.parse(a, this) : a }
+    }), p = (p.kdf = {}).OpenSSL = { execute: function (a, b, c, d) { d || (d = s.random(8)); a = w.create({ keySize: b + c }).compute(a, d); c = s.create(a.words.slice(b), 4 * c); a.sigBytes = 4 * b; return n.create({ key: a, iv: c, salt: d }) } }, c = d.PasswordBasedCipher = a.extend({
+      cfg: a.cfg.extend({ kdf: p }), encrypt: function (b, c, d, l) {
+        l = this.cfg.extend(l); d = l.kdf.execute(d,
+          b.keySize, b.ivSize); l.iv = d.iv; b = a.encrypt.call(this, b, c, d.key, l); b.mixIn(d); return b
+      }, decrypt: function (b, c, d, l) { l = this.cfg.extend(l); c = this._parse(c, l.format); d = l.kdf.execute(d, b.keySize, b.ivSize, c.salt); l.iv = d.iv; return a.decrypt.call(this, b, c, d.key, l) }
+    })
+  }();
+  (function () {
+    for (var u = CryptoJS, p = u.lib.BlockCipher, d = u.algo, l = [], s = [], t = [], r = [], w = [], v = [], b = [], x = [], q = [], n = [], a = [], c = 0; 256 > c; c++)a[c] = 128 > c ? c << 1 : c << 1 ^ 283; for (var e = 0, j = 0, c = 0; 256 > c; c++) { var k = j ^ j << 1 ^ j << 2 ^ j << 3 ^ j << 4, k = k >>> 8 ^ k & 255 ^ 99; l[e] = k; s[k] = e; var z = a[e], F = a[z], G = a[F], y = 257 * a[k] ^ 16843008 * k; t[e] = y << 24 | y >>> 8; r[e] = y << 16 | y >>> 16; w[e] = y << 8 | y >>> 24; v[e] = y; y = 16843009 * G ^ 65537 * F ^ 257 * z ^ 16843008 * e; b[k] = y << 24 | y >>> 8; x[k] = y << 16 | y >>> 16; q[k] = y << 8 | y >>> 24; n[k] = y; e ? (e = z ^ a[a[a[G ^ z]]], j ^= a[a[j]]) : e = j = 1 } var H = [0, 1, 2, 4, 8,
+      16, 32, 64, 128, 27, 54], d = d.AES = p.extend({
+        _doReset: function () {
+          for (var a = this._key, c = a.words, d = a.sigBytes / 4, a = 4 * ((this._nRounds = d + 6) + 1), e = this._keySchedule = [], j = 0; j < a; j++)if (j < d) e[j] = c[j]; else { var k = e[j - 1]; j % d ? 6 < d && 4 == j % d && (k = l[k >>> 24] << 24 | l[k >>> 16 & 255] << 16 | l[k >>> 8 & 255] << 8 | l[k & 255]) : (k = k << 8 | k >>> 24, k = l[k >>> 24] << 24 | l[k >>> 16 & 255] << 16 | l[k >>> 8 & 255] << 8 | l[k & 255], k ^= H[j / d | 0] << 24); e[j] = e[j - d] ^ k } c = this._invKeySchedule = []; for (d = 0; d < a; d++)j = a - d, k = d % 4 ? e[j] : e[j - 4], c[d] = 4 > d || 4 >= j ? k : b[l[k >>> 24]] ^ x[l[k >>> 16 & 255]] ^ q[l[k >>>
+            8 & 255]] ^ n[l[k & 255]]
+        }, encryptBlock: function (a, b) { this._doCryptBlock(a, b, this._keySchedule, t, r, w, v, l) }, decryptBlock: function (a, c) { var d = a[c + 1]; a[c + 1] = a[c + 3]; a[c + 3] = d; this._doCryptBlock(a, c, this._invKeySchedule, b, x, q, n, s); d = a[c + 1]; a[c + 1] = a[c + 3]; a[c + 3] = d }, _doCryptBlock: function (a, b, c, d, e, j, l, f) {
+          for (var m = this._nRounds, g = a[b] ^ c[0], h = a[b + 1] ^ c[1], k = a[b + 2] ^ c[2], n = a[b + 3] ^ c[3], p = 4, r = 1; r < m; r++)var q = d[g >>> 24] ^ e[h >>> 16 & 255] ^ j[k >>> 8 & 255] ^ l[n & 255] ^ c[p++], s = d[h >>> 24] ^ e[k >>> 16 & 255] ^ j[n >>> 8 & 255] ^ l[g & 255] ^ c[p++], t =
+            d[k >>> 24] ^ e[n >>> 16 & 255] ^ j[g >>> 8 & 255] ^ l[h & 255] ^ c[p++], n = d[n >>> 24] ^ e[g >>> 16 & 255] ^ j[h >>> 8 & 255] ^ l[k & 255] ^ c[p++], g = q, h = s, k = t; q = (f[g >>> 24] << 24 | f[h >>> 16 & 255] << 16 | f[k >>> 8 & 255] << 8 | f[n & 255]) ^ c[p++]; s = (f[h >>> 24] << 24 | f[k >>> 16 & 255] << 16 | f[n >>> 8 & 255] << 8 | f[g & 255]) ^ c[p++]; t = (f[k >>> 24] << 24 | f[n >>> 16 & 255] << 16 | f[g >>> 8 & 255] << 8 | f[h & 255]) ^ c[p++]; n = (f[n >>> 24] << 24 | f[g >>> 16 & 255] << 16 | f[h >>> 8 & 255] << 8 | f[k & 255]) ^ c[p++]; a[b] = q; a[b + 1] = s; a[b + 2] = t; a[b + 3] = n
+        }, keySize: 8
+      }); u.AES = p._createHelper(d)
+  })();
+  
+  CryptoJS.encrypt = function (word, key, iv) {
+    return encrypt(word, key, iv)
+  }
+  
+  CryptoJS.decrypt = function (word, key, iv) {
+    return decrypt(word, key, iv)
+  }
+  
+  /**
+   * 加密
+   * word:原密码
+   * key :key
+   * iv  : iv
+   */
+  function encrypt(word, key, iv) { 
+    key = CryptoJS.enc.Utf8.parse(key); 
+    iv = CryptoJS.enc.Utf8.parse(iv); 
+    var encrypted = CryptoJS.AES.encrypt(word, key, {
+      iv: iv,
+      mode: CryptoJS.mode.CBC,
+      padding: CryptoJS.pad.Pkcs7
+    });	 
+    return encrypted.toString();
+  }
+  
+  /**
+   * 解密
+   * word:加密后的密码
+   * key :key
+   * iv  : iv
+   */
+  function decrypt(word, key, iv) {
+    key = CryptoJS.enc.Utf8.parse(key);
+    iv = CryptoJS.enc.Utf8.parse(iv); 
+    var decrypted = CryptoJS.AES.decrypt(word, key, {
+      iv: iv,
+      mode: CryptoJS.mode.CBC,
+      padding: CryptoJS.pad.Pkcs7
+    });
+    decrypted = CryptoJS.enc.Utf8.stringify(decrypted); 
+    return decrypted;
+  }
+  /**
+   * Electronic Codebook block mode.
+   */
+  CryptoJS.mode.ECB = (function () {
+    var ECB = CryptoJS.lib.BlockCipherMode.extend();
+    ECB.Encryptor = ECB.extend({
+        processBlock: function (words, offset) {
+            this._cipher.encryptBlock(words, offset);
+        }
+    });
+    ECB.Decryptor = ECB.extend({
+        processBlock: function (words, offset) {
+            this._cipher.decryptBlock(words, offset);
+        }
+    });
+    return ECB;
+  }());
+  /**
+   * @example
+   * var CryptoJS = require('./util/aes.js')
+   * var key = CryptoJS.enc.Utf8.parse("key");
+   * var iv = CryptoJS.enc.Utf8.parse("iv");
+   * var pwd = CryptoJS.encrypt(this.data.pwdVal, key, iv)
+   * var original = CryptoJS.encrypt(pwd, key, iv)
+   */
+  module.exports = CryptoJS;
+  

+ 80 - 0
utils_sand/aes_util.js

@@ -0,0 +1,80 @@
+const CryptoJS = require('./aes.js'); //引用AES源码js
+const key = CryptoJS.enc.Utf8.parse("1546A43298451599"); //十六位十六进制数作为秘钥
+const iv = CryptoJS.enc.Utf8.parse('0102030405060708');//十六位十六进制数作为秘钥偏移量
+/**
+ * aes cbc解密方法、需要iv偏移量
+ */
+function AesDecrypt(word) {
+  let encryptedHexStr = CryptoJS.enc.Hex.parse(word);
+  let srcs = CryptoJS.enc.Base64.stringify(encryptedHexStr);
+  let decrypt = CryptoJS.AES.decrypt(srcs, key, {
+    iv: iv,
+    mode: CryptoJS.mode.CBC,
+    padding: CryptoJS.pad.Pkcs7
+  });
+  let decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
+  return decryptedStr.toString();
+}
+/**
+ * aes cbc加密方法、需要iv偏移量
+ */
+function AesEncrypt(word) {
+  let srcs = CryptoJS.enc.Utf8.parse(word);
+  let encrypted = CryptoJS.AES.encrypt(srcs, key, {
+    iv: iv,
+    mode: CryptoJS.mode.CBC,
+    padding: CryptoJS.pad.Pkcs7
+  });
+  return encrypted.ciphertext.toString().toUpperCase();
+}
+
+/**
+ * base64 加密方法
+ */
+function Base64Encode(val) {
+  let str = CryptoJS.enc.Utf8.parse(val);
+  let base64 = CryptoJS.enc.Base64.stringify(str);
+  return base64;
+}
+
+/**
+ * base64 解密方法
+ */
+function Base64Decode(val) {
+  let words = CryptoJS.enc.Base64.parse(val);
+  return words.toString(CryptoJS.enc.Utf8);
+}
+
+/**
+ * aes ecb解密方法
+ */
+function AesDecryptECB(word) {
+  let encryptedHexStr = CryptoJS.enc.Hex.parse(word);
+  let srcs = CryptoJS.enc.Base64.stringify(encryptedHexStr);
+  let decrypt = CryptoJS.AES.decrypt(srcs, key, {
+    mode: CryptoJS.mode.ECB,
+    padding: CryptoJS.pad.Pkcs7
+  });
+  let decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
+  return decryptedStr.toString();
+}
+/**
+ * aes ecb加密方法
+ */
+function AesEncryptECB(word) {
+  let srcs = CryptoJS.enc.Utf8.parse(word);
+  let encrypted = CryptoJS.AES.encrypt(srcs, key, {
+    mode: CryptoJS.mode.ECB,
+    padding: CryptoJS.pad.Pkcs7
+  });
+  return encrypted.toString();
+}
+//暴露接口
+module.exports = {
+  AesEncrypt,
+  AesDecrypt,
+  Base64Encode,
+  Base64Decode,
+  AesDecryptECB,
+  AesEncryptECB,
+}

+ 87 - 0
utils_sand/base64.js

@@ -0,0 +1,87 @@
+var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+var base64DecodeChars = new Array(
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
+  52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
+  -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+  15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
+  -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+  41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);
+function base64encode(str) {
+  var out, i, len;
+  var c1, c2, c3;
+  len = str.length;
+  i = 0;
+  out = "";
+  while (i < len) {
+    c1 = str.charCodeAt(i++) & 0xff;
+    if (i == len) {
+      out += base64EncodeChars.charAt(c1 >> 2);
+      out += base64EncodeChars.charAt((c1 & 0x3) << 4);
+      out += "==";
+      break;
+    }
+    c2 = str.charCodeAt(i++);
+    if (i == len) {
+      out += base64EncodeChars.charAt(c1 >> 2);
+      out += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
+      out += base64EncodeChars.charAt((c2 & 0xF) << 2);
+      out += "=";
+      break;
+    }
+    c3 = str.charCodeAt(i++);
+    out += base64EncodeChars.charAt(c1 >> 2);
+    out += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
+    out += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6));
+    out += base64EncodeChars.charAt(c3 & 0x3F);
+  }
+  return out;
+}
+module.exports.base64encode = base64encode;
+
+function base64decode(str) {
+  var c1, c2, c3, c4;
+  var i, len, out;
+  len = str.length;
+  i = 0;
+  out = "";
+  while (i < len) {
+    /* c1 */
+    do {
+      c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
+    } while (i < len && c1 == -1);
+    if (c1 == -1)
+      break;
+    /* c2 */
+    do {
+      c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
+    } while (i < len && c2 == -1);
+    if (c2 == -1)
+      break;
+    out += String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4));
+    /* c3 */
+    do {
+      c3 = str.charCodeAt(i++) & 0xff;
+      if (c3 == 61)
+        return out;
+      c3 = base64DecodeChars[c3];
+    } while (i < len && c3 == -1);
+    if (c3 == -1)
+      break;
+    out += String.fromCharCode(((c2 & 0XF) << 4) | ((c3 & 0x3C) >> 2));
+    /* c4 */
+    do {
+      c4 = str.charCodeAt(i++) & 0xff;
+      if (c4 == 61)
+        return out;
+      c4 = base64DecodeChars[c4];
+    } while (i < len && c4 == -1);
+    if (c4 == -1)
+      break;
+    out += String.fromCharCode(((c3 & 0x03) << 6) | c4);
+  }
+  return out;
+}
+ 
+module.exports.base64decode = base64decode;

+ 324 - 0
utils_sand/des.js

@@ -0,0 +1,324 @@
+var Base64 = require("./base64")
+var des3iv = '12345678';
+/**
+* 3DES加密,ECB/PKCS5Padding
+*/
+function encrypt(data, key) {
+  var genKey = genkey(key, 0, 24);
+  var str = des(genKey.key, data, 1, 0, des3iv, 0);
+  return Base64.base64encode(str);
+}
+module.exports.encrypt = encrypt;
+ 
+/**
+* 3DES解密,ECB/PKCS5Padding
+*/
+function decrypt(data, key) {
+  var genKey = genkey(key, 0, 24);
+  var str = Base64.base64decode(data);
+  return des(genKey.key, str, 0, 0, des3iv, 0);
+}
+module.exports.decrypt = decrypt;
+
+/**
+ * DES 加密算法
+ *
+ * 该函数接受一个 8 字节字符串作为普通 DES 算法的密钥(也就是 64 位,但是算法只使用 56 位),或者接受一个 24 字节字符串作为 3DES
+ * 算法的密钥;第二个参数是要加密或解密的信息字符串;第三个布尔值参数用来说明信息是加密还是解密;接下来的可选参数 mode 如果是 0 表示 ECB
+ * 模式,1 表示 CBC 模式,默认是 ECB 模式;最后一个可选项是一个 8 字节的输入向量字符串(在 ECB 模式下不使用)。返回的密文是字符串。
+ *
+ * 参数: <br>
+ * key: 8字节字符串作为普通 DES 算法的密钥,或 24 字节字符串作为 3DES <br>
+ * message: 加密或解密的信息字符串<br>
+ * encrypt: 布尔值参数用来说明信息是加密还是解密<br>
+ * mode: 1:CBC模式,0:ECB模式(默认)<br>
+ * iv:<br>
+ * padding: 可选项, 8字节的输入向量字符串(在 ECB 模式下不使用)
+ */
+//des http://www.cnblogs.com/bullub/archive/2013/05/02/3054798.html
+//this takes the key, the message, and whether to encrypt or decrypt
+function des(key, message, encrypt, mode, iv, padding) {
+  if (encrypt) {//如果是加密的话,首先转换编码
+    message = unescape(encodeURIComponent(message));
+  }
+
+  //declaring this locally speeds things up a bit
+  var spfunction1 = new Array(0x1010400, 0, 0x10000, 0x1010404, 0x1010004, 0x10404, 0x4, 0x10000, 0x400, 0x1010400, 0x1010404, 0x400, 0x1000404, 0x1010004, 0x1000000, 0x4, 0x404, 0x1000400, 0x1000400, 0x10400, 0x10400, 0x1010000, 0x1010000, 0x1000404, 0x10004, 0x1000004, 0x1000004, 0x10004, 0, 0x404, 0x10404, 0x1000000, 0x10000, 0x1010404, 0x4, 0x1010000, 0x1010400, 0x1000000, 0x1000000, 0x400, 0x1010004, 0x10000, 0x10400, 0x1000004, 0x400, 0x4, 0x1000404, 0x10404, 0x1010404, 0x10004, 0x1010000, 0x1000404, 0x1000004, 0x404, 0x10404, 0x1010400, 0x404, 0x1000400, 0x1000400, 0, 0x10004, 0x10400, 0, 0x1010004);
+  var spfunction2 = new Array(-0x7fef7fe0, -0x7fff8000, 0x8000, 0x108020, 0x100000, 0x20, -0x7fefffe0, -0x7fff7fe0, -0x7fffffe0, -0x7fef7fe0, -0x7fef8000, -0x80000000, -0x7fff8000, 0x100000, 0x20, -0x7fefffe0, 0x108000, 0x100020, -0x7fff7fe0, 0, -0x80000000, 0x8000, 0x108020, -0x7ff00000, 0x100020, -0x7fffffe0, 0, 0x108000, 0x8020, -0x7fef8000, -0x7ff00000, 0x8020, 0, 0x108020, -0x7fefffe0, 0x100000, -0x7fff7fe0, -0x7ff00000, -0x7fef8000, 0x8000, -0x7ff00000, -0x7fff8000, 0x20, -0x7fef7fe0, 0x108020, 0x20, 0x8000, -0x80000000, 0x8020, -0x7fef8000, 0x100000, -0x7fffffe0, 0x100020, -0x7fff7fe0, -0x7fffffe0, 0x100020, 0x108000, 0, -0x7fff8000, 0x8020, -0x80000000, -0x7fefffe0, -0x7fef7fe0, 0x108000);
+  var spfunction3 = new Array(0x208, 0x8020200, 0, 0x8020008, 0x8000200, 0, 0x20208, 0x8000200, 0x20008, 0x8000008, 0x8000008, 0x20000, 0x8020208, 0x20008, 0x8020000, 0x208, 0x8000000, 0x8, 0x8020200, 0x200, 0x20200, 0x8020000, 0x8020008, 0x20208, 0x8000208, 0x20200, 0x20000, 0x8000208, 0x8, 0x8020208, 0x200, 0x8000000, 0x8020200, 0x8000000, 0x20008, 0x208, 0x20000, 0x8020200, 0x8000200, 0, 0x200, 0x20008, 0x8020208, 0x8000200, 0x8000008, 0x200, 0, 0x8020008, 0x8000208, 0x20000, 0x8000000, 0x8020208, 0x8, 0x20208, 0x20200, 0x8000008, 0x8020000, 0x8000208, 0x208, 0x8020000, 0x20208, 0x8, 0x8020008, 0x20200);
+  var spfunction4 = new Array(0x802001, 0x2081, 0x2081, 0x80, 0x802080, 0x800081, 0x800001, 0x2001, 0, 0x802000, 0x802000, 0x802081, 0x81, 0, 0x800080, 0x800001, 0x1, 0x2000, 0x800000, 0x802001, 0x80, 0x800000, 0x2001, 0x2080, 0x800081, 0x1, 0x2080, 0x800080, 0x2000, 0x802080, 0x802081, 0x81, 0x800080, 0x800001, 0x802000, 0x802081, 0x81, 0, 0, 0x802000, 0x2080, 0x800080, 0x800081, 0x1, 0x802001, 0x2081, 0x2081, 0x80, 0x802081, 0x81, 0x1, 0x2000, 0x800001, 0x2001, 0x802080, 0x800081, 0x2001, 0x2080, 0x800000, 0x802001, 0x80, 0x800000, 0x2000, 0x802080);
+  var spfunction5 = new Array(0x100, 0x2080100, 0x2080000, 0x42000100, 0x80000, 0x100, 0x40000000, 0x2080000, 0x40080100, 0x80000, 0x2000100, 0x40080100, 0x42000100, 0x42080000, 0x80100, 0x40000000, 0x2000000, 0x40080000, 0x40080000, 0, 0x40000100, 0x42080100, 0x42080100, 0x2000100, 0x42080000, 0x40000100, 0, 0x42000000, 0x2080100, 0x2000000, 0x42000000, 0x80100, 0x80000, 0x42000100, 0x100, 0x2000000, 0x40000000, 0x2080000, 0x42000100, 0x40080100, 0x2000100, 0x40000000, 0x42080000, 0x2080100, 0x40080100, 0x100, 0x2000000, 0x42080000, 0x42080100, 0x80100, 0x42000000, 0x42080100, 0x2080000, 0, 0x40080000, 0x42000000, 0x80100, 0x2000100, 0x40000100, 0x80000, 0, 0x40080000, 0x2080100, 0x40000100);
+  var spfunction6 = new Array(0x20000010, 0x20400000, 0x4000, 0x20404010, 0x20400000, 0x10, 0x20404010, 0x400000, 0x20004000, 0x404010, 0x400000, 0x20000010, 0x400010, 0x20004000, 0x20000000, 0x4010, 0, 0x400010, 0x20004010, 0x4000, 0x404000, 0x20004010, 0x10, 0x20400010, 0x20400010, 0, 0x404010, 0x20404000, 0x4010, 0x404000, 0x20404000, 0x20000000, 0x20004000, 0x10, 0x20400010, 0x404000, 0x20404010, 0x400000, 0x4010, 0x20000010, 0x400000, 0x20004000, 0x20000000, 0x4010, 0x20000010, 0x20404010, 0x404000, 0x20400000, 0x404010, 0x20404000, 0, 0x20400010, 0x10, 0x4000, 0x20400000, 0x404010, 0x4000, 0x400010, 0x20004010, 0, 0x20404000, 0x20000000, 0x400010, 0x20004010);
+  var spfunction7 = new Array(0x200000, 0x4200002, 0x4000802, 0, 0x800, 0x4000802, 0x200802, 0x4200800, 0x4200802, 0x200000, 0, 0x4000002, 0x2, 0x4000000, 0x4200002, 0x802, 0x4000800, 0x200802, 0x200002, 0x4000800, 0x4000002, 0x4200000, 0x4200800, 0x200002, 0x4200000, 0x800, 0x802, 0x4200802, 0x200800, 0x2, 0x4000000, 0x200800, 0x4000000, 0x200800, 0x200000, 0x4000802, 0x4000802, 0x4200002, 0x4200002, 0x2, 0x200002, 0x4000000, 0x4000800, 0x200000, 0x4200800, 0x802, 0x200802, 0x4200800, 0x802, 0x4000002, 0x4200802, 0x4200000, 0x200800, 0, 0x2, 0x4200802, 0, 0x200802, 0x4200000, 0x800, 0x4000002, 0x4000800, 0x800, 0x200002);
+  var spfunction8 = new Array(0x10001040, 0x1000, 0x40000, 0x10041040, 0x10000000, 0x10001040, 0x40, 0x10000000, 0x40040, 0x10040000, 0x10041040, 0x41000, 0x10041000, 0x41040, 0x1000, 0x40, 0x10040000, 0x10000040, 0x10001000, 0x1040, 0x41000, 0x40040, 0x10040040, 0x10041000, 0x1040, 0, 0, 0x10040040, 0x10000040, 0x10001000, 0x41040, 0x40000, 0x41040, 0x40000, 0x10041000, 0x1000, 0x40, 0x10040040, 0x1000, 0x41040, 0x10001000, 0x40, 0x10000040, 0x10040000, 0x10040040, 0x10000000, 0x40000, 0x10001040, 0, 0x10041040, 0x40040, 0x10000040, 0x10040000, 0x10001000, 0x10001040, 0, 0x10041040, 0x41000, 0x41000, 0x1040, 0x1040, 0x40040, 0x10000000, 0x10041000);
+ 
+  //create the 16 or 48 subkeys we will need
+  var keys = des_createKeys(key);
+  var m = 0, i, j, temp, temp2, right1, right2, left, right, looping;
+  var cbcleft, cbcleft2, cbcright, cbcright2
+  var endloop, loopinc;
+  var len = message.length;
+  var chunk = 0;
+  //set up the loops for single and triple des
+  var iterations = keys.length == 32 ? 3 : 9; //single or triple des
+  if (iterations == 3) {
+    looping = encrypt ? new Array(0, 32, 2) : new Array(30, -2, -2);
+  } else {
+    looping = encrypt ? new Array(0, 32, 2, 62, 30, -2, 64, 96, 2) : new Array(94, 62, -2, 32, 64, 2, 30, -2, -2);
+  }
+
+  //pad the message depending on the padding parameter
+  if (padding == 2) {
+    message += "        "; //pad the message with spaces
+  } else if (padding == 1) { //PKCS5Padding
+    if (encrypt) {
+      temp = 8 - (len % 8);
+      message += String.fromCharCode(temp, temp, temp, temp, temp, temp, temp, temp);
+      if (temp === 8) len += 8;
+    }
+  } else if (!padding) { //NoPadding
+    // message += "\0\0\0\0\0\0\0\0"; //pad the message out with null bytes
+    if (encrypt) {
+      var mesByte = stringToByte(message);
+      var iLen = mesByte.length % 8;
+      var padByte = [], desByte = [];
+      if (iLen == 0) {
+        padByte = new Array(8).fill(0);
+        var desByte = new Array(mesByte.length + 8);
+        for (var i = 0; i < mesByte.length; i++) {
+            desByte[i] = mesByte[i];
+        }
+        for (var j = 0; j < 8; j++) {
+            desByte[mesByte.length + j] = padByte[j];
+        }
+        message = byteToString(desByte);
+        len = message.length;
+      } else {
+        var pLen = 8 - iLen;
+        padByte = new Array(pLen).fill(0);
+        var desByte = new Array(mesByte.length + pLen);
+        for (var i = 0; i < mesByte.length; i++) {
+            desByte[i] = mesByte[i];
+        }
+        for (var j = 0; j < pLen; j++) {
+            desByte[mesByte.length + j] = padByte[j];
+        }
+        message = byteToString(desByte);
+        len = message.length;
+      }
+    }
+  }
+
+  //store the result here
+  var result = "";
+  var tempresult = "";
+
+  if (mode == 1) { //CBC mode
+    cbcleft = (iv.charCodeAt(m++) << 24) | (iv.charCodeAt(m++) << 16) | (iv.charCodeAt(m++) << 8) | iv.charCodeAt(m++);
+    cbcright = (iv.charCodeAt(m++) << 24) | (iv.charCodeAt(m++) << 16) | (iv.charCodeAt(m++) << 8) | iv.charCodeAt(m++);
+    m = 0;
+  }
+
+  //loop through each 64 bit chunk of the message
+  while (m < len) {
+    left = (message.charCodeAt(m++) << 24) | (message.charCodeAt(m++) << 16) | (message.charCodeAt(m++) << 8) | message.charCodeAt(m++);
+    right = (message.charCodeAt(m++) << 24) | (message.charCodeAt(m++) << 16) | (message.charCodeAt(m++) << 8) | message.charCodeAt(m++);
+ 
+    //for Cipher Block Chaining mode, xor the message with the previous result
+    if (mode == 1) {
+      if (encrypt) {
+        left ^= cbcleft; right ^= cbcright;
+      } else {
+        cbcleft2 = cbcleft; cbcright2 = cbcright; cbcleft = left; cbcright = right;
+      }
+    }
+
+    //first each 64 but chunk of the message must be permuted according to IP
+    temp = ((left >>> 4) ^ right) & 0x0f0f0f0f; right ^= temp; left ^= (temp << 4);
+    temp = ((left >>> 16) ^ right) & 0x0000ffff; right ^= temp; left ^= (temp << 16);
+    temp = ((right >>> 2) ^ left) & 0x33333333; left ^= temp; right ^= (temp << 2);
+    temp = ((right >>> 8) ^ left) & 0x00ff00ff; left ^= temp; right ^= (temp << 8);
+    temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);
+ 
+    left = ((left << 1) | (left >>> 31));
+    right = ((right << 1) | (right >>> 31));
+ 
+    //do this either 1 or 3 times for each chunk of the message
+    for (j = 0; j < iterations; j += 3) {
+      endloop = looping[j + 1];
+      loopinc = looping[j + 2];
+      //now go through and perform the encryption or decryption
+      for (i = looping[j]; i != endloop; i += loopinc) { //for efficiency
+        right1 = right ^ keys[i];
+        right2 = ((right >>> 4) | (right << 28)) ^ keys[i + 1];
+        //the result is attained by passing these bytes through the S selection functions
+        temp = left;
+        left = right;
+        right = temp ^ (spfunction2[(right1 >>> 24) & 0x3f] | spfunction4[(right1 >>> 16) & 0x3f]
+          | spfunction6[(right1 >>> 8) & 0x3f] | spfunction8[right1 & 0x3f]
+          | spfunction1[(right2 >>> 24) & 0x3f] | spfunction3[(right2 >>> 16) & 0x3f]
+          | spfunction5[(right2 >>> 8) & 0x3f] | spfunction7[right2 & 0x3f]);
+      }
+      temp = left; left = right; right = temp; //unreverse left and right
+    } //for either 1 or 3 iterations
+ 
+    //move then each one bit to the right
+    left = ((left >>> 1) | (left << 31));
+    right = ((right >>> 1) | (right << 31));
+ 
+    //now perform IP-1, which is IP in the opposite direction
+    temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);
+    temp = ((right >>> 8) ^ left) & 0x00ff00ff; left ^= temp; right ^= (temp << 8);
+    temp = ((right >>> 2) ^ left) & 0x33333333; left ^= temp; right ^= (temp << 2);
+    temp = ((left >>> 16) ^ right) & 0x0000ffff; right ^= temp; left ^= (temp << 16);
+    temp = ((left >>> 4) ^ right) & 0x0f0f0f0f; right ^= temp; left ^= (temp << 4);
+ 
+    //for Cipher Block Chaining mode, xor the message with the previous result
+    if (mode == 1) {
+      if (encrypt) {
+        cbcleft = left; cbcright = right;
+      } else {
+        left ^= cbcleft2; right ^= cbcright2;
+      }
+    }
+
+    tempresult += String.fromCharCode((left >>> 24), ((left >>> 16) & 0xff), ((left >>> 8) & 0xff), (left & 0xff), (right >>> 24), ((right >>> 16) & 0xff), ((right >>> 8) & 0xff), (right & 0xff));
+ 
+    chunk += 8;
+    if (chunk == 512) {
+      result += tempresult; tempresult = ""; chunk = 0;
+    }
+  } //for every 8 characters, or 64 bits in the message
+ 
+  //return the result as an array
+  result += tempresult;
+  result = result.replace(/\0*$/g, "");
+ 
+  if (!encrypt) { //如果是解密的话,解密结束后对PKCS7 padding进行解码,并转换成utf-8编码
+    if (padding === 1) { //PKCS7 padding解码
+      var len = result.length, paddingChars = 0;
+      len && (paddingChars = result.charCodeAt(len - 1));
+      (paddingChars <= 8) && (result = result.substring(0, len - paddingChars));
+    }
+    //转换成UTF-8编码
+    result = decodeURIComponent(escape(result));
+  }
+ 
+  return result;
+} //end of des
+
+//des_createKeys
+//this takes as input a 64 bit key (even though only 56 bits are used)
+//as an array of 2 integers, and returns 16 48 bit keys
+function des_createKeys(key) {
+  //declaring this locally speeds things up a bit
+  var pc2bytes0 = new Array(0, 0x4, 0x20000000, 0x20000004, 0x10000, 0x10004, 0x20010000, 0x20010004, 0x200, 0x204, 0x20000200, 0x20000204, 0x10200, 0x10204, 0x20010200, 0x20010204);
+  var pc2bytes1 = new Array(0, 0x1, 0x100000, 0x100001, 0x4000000, 0x4000001, 0x4100000, 0x4100001, 0x100, 0x101, 0x100100, 0x100101, 0x4000100, 0x4000101, 0x4100100, 0x4100101);
+  var pc2bytes2 = new Array(0, 0x8, 0x800, 0x808, 0x1000000, 0x1000008, 0x1000800, 0x1000808, 0, 0x8, 0x800, 0x808, 0x1000000, 0x1000008, 0x1000800, 0x1000808);
+  var pc2bytes3 = new Array(0, 0x200000, 0x8000000, 0x8200000, 0x2000, 0x202000, 0x8002000, 0x8202000, 0x20000, 0x220000, 0x8020000, 0x8220000, 0x22000, 0x222000, 0x8022000, 0x8222000);
+  var pc2bytes4 = new Array(0, 0x40000, 0x10, 0x40010, 0, 0x40000, 0x10, 0x40010, 0x1000, 0x41000, 0x1010, 0x41010, 0x1000, 0x41000, 0x1010, 0x41010);
+  var pc2bytes5 = new Array(0, 0x400, 0x20, 0x420, 0, 0x400, 0x20, 0x420, 0x2000000, 0x2000400, 0x2000020, 0x2000420, 0x2000000, 0x2000400, 0x2000020, 0x2000420);
+  var pc2bytes6 = new Array(0, 0x10000000, 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002, 0, 0x10000000, 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002);
+  var pc2bytes7 = new Array(0, 0x10000, 0x800, 0x10800, 0x20000000, 0x20010000, 0x20000800, 0x20010800, 0x20000, 0x30000, 0x20800, 0x30800, 0x20020000, 0x20030000, 0x20020800, 0x20030800);
+  var pc2bytes8 = new Array(0, 0x40000, 0, 0x40000, 0x2, 0x40002, 0x2, 0x40002, 0x2000000, 0x2040000, 0x2000000, 0x2040000, 0x2000002, 0x2040002, 0x2000002, 0x2040002);
+  var pc2bytes9 = new Array(0, 0x10000000, 0x8, 0x10000008, 0, 0x10000000, 0x8, 0x10000008, 0x400, 0x10000400, 0x408, 0x10000408, 0x400, 0x10000400, 0x408, 0x10000408);
+  var pc2bytes10 = new Array(0, 0x20, 0, 0x20, 0x100000, 0x100020, 0x100000, 0x100020, 0x2000, 0x2020, 0x2000, 0x2020, 0x102000, 0x102020, 0x102000, 0x102020);
+  var pc2bytes11 = new Array(0, 0x1000000, 0x200, 0x1000200, 0x200000, 0x1200000, 0x200200, 0x1200200, 0x4000000, 0x5000000, 0x4000200, 0x5000200, 0x4200000, 0x5200000, 0x4200200, 0x5200200);
+  var pc2bytes12 = new Array(0, 0x1000, 0x8000000, 0x8001000, 0x80000, 0x81000, 0x8080000, 0x8081000, 0x10, 0x1010, 0x8000010, 0x8001010, 0x80010, 0x81010, 0x8080010, 0x8081010);
+  var pc2bytes13 = new Array(0, 0x4, 0x100, 0x104, 0, 0x4, 0x100, 0x104, 0x1, 0x5, 0x101, 0x105, 0x1, 0x5, 0x101, 0x105);
+ 
+  //how many iterations (1 for des, 3 for triple des)
+  var iterations = key.length > 8 ? 3 : 1; //changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys
+  //stores the return keys
+  var keys = new Array(32 * iterations);
+  //now define the left shifts which need to be done
+  var shifts = new Array(0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0);
+  //other variables
+  var lefttemp, righttemp, m = 0, n = 0, temp;
+ 
+  for (var j = 0; j < iterations; j++) { //either 1 or 3 iterations
+    var left = (key.charCodeAt(m++) << 24) | (key.charCodeAt(m++) << 16) | (key.charCodeAt(m++) << 8) | key.charCodeAt(m++);
+    var right = (key.charCodeAt(m++) << 24) | (key.charCodeAt(m++) << 16) | (key.charCodeAt(m++) << 8) | key.charCodeAt(m++);
+ 
+    temp = ((left >>> 4) ^ right) & 0x0f0f0f0f; right ^= temp; left ^= (temp << 4);
+    temp = ((right >>> -16) ^ left) & 0x0000ffff; left ^= temp; right ^= (temp << -16);
+    temp = ((left >>> 2) ^ right) & 0x33333333; right ^= temp; left ^= (temp << 2);
+    temp = ((right >>> -16) ^ left) & 0x0000ffff; left ^= temp; right ^= (temp << -16);
+    temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);
+    temp = ((right >>> 8) ^ left) & 0x00ff00ff; left ^= temp; right ^= (temp << 8);
+    temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);
+ 
+    //the right side needs to be shifted and to get the last four bits of the left side
+    temp = (left << 8) | ((right >>> 20) & 0x000000f0);
+    //left needs to be put upside down
+    left = (right << 24) | ((right << 8) & 0xff0000) | ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0);
+    right = temp;
+ 
+    //now go through and perform these shifts on the left and right keys
+    for (var i = 0; i < shifts.length; i++) {
+      //shift the keys either one or two bits to the left
+      if (shifts[i]) {
+        left = (left << 2) | (left >>> 26); right = (right << 2) | (right >>> 26);
+      } else {
+        left = (left << 1) | (left >>> 27); right = (right << 1) | (right >>> 27);
+      }
+      left &= -0xf; right &= -0xf;
+
+      //now apply PC-2, in such a way that E is easier when encrypting or decrypting
+      //this conversion will look like PC-2 except only the last 6 bits of each byte are used
+      //rather than 48 consecutive bits and the order of lines will be according to
+      //how the S selection functions will be applied: S2, S4, S6, S8, S1, S3, S5, S7
+      lefttemp = pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf]
+        | pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf]
+        | pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf]
+        | pc2bytes6[(left >>> 4) & 0xf];
+      righttemp = pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf]
+        | pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf]
+        | pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf]
+        | pc2bytes13[(right >>> 4) & 0xf];
+      temp = ((righttemp >>> 16) ^ lefttemp) & 0x0000ffff;
+      keys[n++] = lefttemp ^ temp; keys[n++] = righttemp ^ (temp << 16);
+    }
+  } //for each iterations
+  //return the keys we've created
+  return keys;
+} //end of des_createKeys
+function genkey(key, start, end) {
+  //8 byte / 64 bit Key (DES) or 192 bit Key
+  return { key: pad(key.slice(start, end)), vector: 1 };
+}
+function pad(key) {
+  for (var i = key.length; i < 24; i++) {
+    key += "0";
+  }
+  return key;
+}
+function stringToHex(str) {
+  var res = "0x";
+  var hexes = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
+  for (var i = 0; i < str.length; i++) {
+    res += hexes[str.charCodeAt(i) >> 4] + hexes[str.charCodeAt(i) & 0xf];
+  }
+  return res;
+}
+function hexToString(hexStr) {
+  var res = "";
+  for (var i = (hexStr.substr(0, 2) == "0x") ? 2 : 0; i < hexStr.length; i += 2) {
+    res += String.fromCharCode(parseInt(hexStr.substr(i, 2), 16));
+  }
+  return res;
+}
+function byteToString(arr) {
+  var str = "";
+  for (var i = 0; i < arr.length; i++) {
+    str += String.fromCharCode(arr[i]);
+  }
+  return str;
+}
+function stringToByte(str) {
+  var arr = [];
+  for (var i = 0; i< str.length; i++) {
+    arr.push(str.charCodeAt(i));
+  }
+  return new Uint8Array(arr);
+}

+ 205 - 0
utils_sand/md5.js

@@ -0,0 +1,205 @@
+/* 
+ * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message 
+ * Digest Algorithm, as defined in RFC 1321. 
+ * Version 1.1 Copyright (C) Paul Johnston 1999 - 2002. 
+ * Code also contributed by Greg Holt 
+ * See http://pajhome.org.uk/site/legal.html for details. 
+ */
+
+/* 
+ * Add integers, wrapping at 2^32. This uses 16-bit operations internally 
+ * to work around bugs in some JS interpreters. 
+ */
+function safe_add(x, y) {
+  var lsw = (x & 0xFFFF) + (y & 0xFFFF)
+  var msw = (x >> 16) + (y >> 16) + (lsw >> 16)
+  return (msw << 16) | (lsw & 0xFFFF)
+}
+
+/* 
+ * Bitwise rotate a 32-bit number to the left. 
+ */
+function rol(num, cnt) {
+  return (num << cnt) | (num >>> (32 - cnt))
+}
+
+/* 
+ * These functions implement the four basic operations the algorithm uses. 
+ */
+function cmn(q, a, b, x, s, t) {
+  return safe_add(rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b)
+}
+function ff(a, b, c, d, x, s, t) {
+  return cmn((b & c) | ((~b) & d), a, b, x, s, t)
+}
+function gg(a, b, c, d, x, s, t) {
+  return cmn((b & d) | (c & (~d)), a, b, x, s, t)
+}
+function hh(a, b, c, d, x, s, t) {
+  return cmn(b ^ c ^ d, a, b, x, s, t)
+}
+function ii(a, b, c, d, x, s, t) {
+  return cmn(c ^ (b | (~d)), a, b, x, s, t)
+}
+
+/* 
+ * Calculate the MD5 of an array of little-endian words, producing an array 
+ * of little-endian words. 
+ */
+function coreMD5(x) {
+  var a = 1732584193
+  var b = -271733879
+  var c = -1732584194
+  var d = 271733878
+
+  for (var i = 0; i < x.length; i += 16) {
+    var olda = a
+    var oldb = b
+    var oldc = c
+    var oldd = d
+
+    a = ff(a, b, c, d, x[i + 0], 7, -680876936)
+    d = ff(d, a, b, c, x[i + 1], 12, -389564586)
+    c = ff(c, d, a, b, x[i + 2], 17, 606105819)
+    b = ff(b, c, d, a, x[i + 3], 22, -1044525330)
+    a = ff(a, b, c, d, x[i + 4], 7, -176418897)
+    d = ff(d, a, b, c, x[i + 5], 12, 1200080426)
+    c = ff(c, d, a, b, x[i + 6], 17, -1473231341)
+    b = ff(b, c, d, a, x[i + 7], 22, -45705983)
+    a = ff(a, b, c, d, x[i + 8], 7, 1770035416)
+    d = ff(d, a, b, c, x[i + 9], 12, -1958414417)
+    c = ff(c, d, a, b, x[i + 10], 17, -42063)
+    b = ff(b, c, d, a, x[i + 11], 22, -1990404162)
+    a = ff(a, b, c, d, x[i + 12], 7, 1804603682)
+    d = ff(d, a, b, c, x[i + 13], 12, -40341101)
+    c = ff(c, d, a, b, x[i + 14], 17, -1502002290)
+    b = ff(b, c, d, a, x[i + 15], 22, 1236535329)
+
+    a = gg(a, b, c, d, x[i + 1], 5, -165796510)
+    d = gg(d, a, b, c, x[i + 6], 9, -1069501632)
+    c = gg(c, d, a, b, x[i + 11], 14, 643717713)
+    b = gg(b, c, d, a, x[i + 0], 20, -373897302)
+    a = gg(a, b, c, d, x[i + 5], 5, -701558691)
+    d = gg(d, a, b, c, x[i + 10], 9, 38016083)
+    c = gg(c, d, a, b, x[i + 15], 14, -660478335)
+    b = gg(b, c, d, a, x[i + 4], 20, -405537848)
+    a = gg(a, b, c, d, x[i + 9], 5, 568446438)
+    d = gg(d, a, b, c, x[i + 14], 9, -1019803690)
+    c = gg(c, d, a, b, x[i + 3], 14, -187363961)
+    b = gg(b, c, d, a, x[i + 8], 20, 1163531501)
+    a = gg(a, b, c, d, x[i + 13], 5, -1444681467)
+    d = gg(d, a, b, c, x[i + 2], 9, -51403784)
+    c = gg(c, d, a, b, x[i + 7], 14, 1735328473)
+    b = gg(b, c, d, a, x[i + 12], 20, -1926607734)
+
+    a = hh(a, b, c, d, x[i + 5], 4, -378558)
+    d = hh(d, a, b, c, x[i + 8], 11, -2022574463)
+    c = hh(c, d, a, b, x[i + 11], 16, 1839030562)
+    b = hh(b, c, d, a, x[i + 14], 23, -35309556)
+    a = hh(a, b, c, d, x[i + 1], 4, -1530992060)
+    d = hh(d, a, b, c, x[i + 4], 11, 1272893353)
+    c = hh(c, d, a, b, x[i + 7], 16, -155497632)
+    b = hh(b, c, d, a, x[i + 10], 23, -1094730640)
+    a = hh(a, b, c, d, x[i + 13], 4, 681279174)
+    d = hh(d, a, b, c, x[i + 0], 11, -358537222)
+    c = hh(c, d, a, b, x[i + 3], 16, -722521979)
+    b = hh(b, c, d, a, x[i + 6], 23, 76029189)
+    a = hh(a, b, c, d, x[i + 9], 4, -640364487)
+    d = hh(d, a, b, c, x[i + 12], 11, -421815835)
+    c = hh(c, d, a, b, x[i + 15], 16, 530742520)
+    b = hh(b, c, d, a, x[i + 2], 23, -995338651)
+
+    a = ii(a, b, c, d, x[i + 0], 6, -198630844)
+    d = ii(d, a, b, c, x[i + 7], 10, 1126891415)
+    c = ii(c, d, a, b, x[i + 14], 15, -1416354905)
+    b = ii(b, c, d, a, x[i + 5], 21, -57434055)
+    a = ii(a, b, c, d, x[i + 12], 6, 1700485571)
+    d = ii(d, a, b, c, x[i + 3], 10, -1894986606)
+    c = ii(c, d, a, b, x[i + 10], 15, -1051523)
+    b = ii(b, c, d, a, x[i + 1], 21, -2054922799)
+    a = ii(a, b, c, d, x[i + 8], 6, 1873313359)
+    d = ii(d, a, b, c, x[i + 15], 10, -30611744)
+    c = ii(c, d, a, b, x[i + 6], 15, -1560198380)
+    b = ii(b, c, d, a, x[i + 13], 21, 1309151649)
+    a = ii(a, b, c, d, x[i + 4], 6, -145523070)
+    d = ii(d, a, b, c, x[i + 11], 10, -1120210379)
+    c = ii(c, d, a, b, x[i + 2], 15, 718787259)
+    b = ii(b, c, d, a, x[i + 9], 21, -343485551)
+
+    a = safe_add(a, olda)
+    b = safe_add(b, oldb)
+    c = safe_add(c, oldc)
+    d = safe_add(d, oldd)
+  }
+  return [a, b, c, d]
+}
+
+/* 
+ * Convert an array of little-endian words to a hex string. 
+ */
+function binl2hex(binarray) {
+  var hex_tab = "0123456789abcdef"
+  var str = ""
+  for (var i = 0; i < binarray.length * 4; i++) {
+    str += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xF) +
+      hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xF)
+  }
+  return str
+}
+
+/* 
+ * Convert an array of little-endian words to a base64 encoded string. 
+ */
+function binl2b64(binarray) {
+  var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
+  var str = ""
+  for (var i = 0; i < binarray.length * 32; i += 6) {
+    str += tab.charAt(((binarray[i >> 5] << (i % 32)) & 0x3F) |
+      ((binarray[i >> 5 + 1] >> (32 - i % 32)) & 0x3F))
+  }
+  return str
+}
+
+/* 
+ * Convert an 8-bit character string to a sequence of 16-word blocks, stored 
+ * as an array, and append appropriate padding for MD4/5 calculation. 
+ * If any of the characters are >255, the high byte is silently ignored. 
+ */
+function str2binl(str) {
+  var nblk = ((str.length + 8) >> 6) + 1 // number of 16-word blocks  
+  var blks = new Array(nblk * 16)
+  for (var i = 0; i < nblk * 16; i++) blks[i] = 0
+  for (var i = 0; i < str.length; i++)
+    blks[i >> 2] |= (str.charCodeAt(i) & 0xFF) << ((i % 4) * 8)
+  blks[i >> 2] |= 0x80 << ((i % 4) * 8)
+  blks[nblk * 16 - 2] = str.length * 8
+  return blks
+}
+
+/* 
+ * Convert a wide-character string to a sequence of 16-word blocks, stored as 
+ * an array, and append appropriate padding for MD4/5 calculation. 
+ */
+function strw2binl(str) {
+  var nblk = ((str.length + 4) >> 5) + 1 // number of 16-word blocks  
+  var blks = new Array(nblk * 16)
+  for (var i = 0; i < nblk * 16; i++) blks[i] = 0
+  for (var i = 0; i < str.length; i++)
+    blks[i >> 1] |= str.charCodeAt(i) << ((i % 2) * 16)
+  blks[i >> 1] |= 0x80 << ((i % 2) * 16)
+  blks[nblk * 16 - 2] = str.length * 16
+  return blks
+}
+
+/* 
+ * External interface 
+ */
+function hexMD5(str) { return binl2hex(coreMD5(str2binl(str))) }
+function hexMD5w(str) { return binl2hex(coreMD5(strw2binl(str))) }
+function b64MD5(str) { return binl2b64(coreMD5(str2binl(str))) }
+function b64MD5w(str) { return binl2b64(coreMD5(strw2binl(str))) }
+/* Backward compatibility */
+function calcMD5(str) { return binl2hex(coreMD5(str2binl(str))) }
+module.exports = {
+  hexMD5: hexMD5
+}  

+ 108 - 0
utils_sand/util.js

@@ -0,0 +1,108 @@
+const formatTime1 = date => {
+  const year = date.getFullYear()
+  const month = date.getMonth() + 1
+  const day = date.getDate()
+  const hour = date.getHours()
+  const minute = date.getMinutes()
+  const second = date.getSeconds()
+
+  return [year, month, day].map(formatNumber).join('')  + [hour, minute, second].map(formatNumber).join('')
+}
+
+const formatTime = date => {
+  const year = date.getFullYear()
+  const month = date.getMonth() + 1
+  const day = date.getDate()
+  const hour = date.getHours()
+  const minute = date.getMinutes()
+  const second = date.getSeconds()
+
+  return [year, month, day].map(formatNumber).join('-')
+   + ' ' + [hour, minute, second].map(formatNumber).join(':')
+}
+
+const formatNumber = n => {
+  n = n.toString()
+  return n[1] ? n : '0' + n
+}
+
+const Tips = function (opt, to_url) {
+  if (typeof opt == 'string') {
+    to_url = opt;
+    opt = {};
+  }
+  var title = opt.title || '', icon = opt.icon || 'none', endtime = opt.endtime || 2000;
+  if (title) {
+    wx.showToast({ title: title, icon: icon, duration: endtime })
+    // setTimeout(function () {
+    //   wx.reLaunch({
+    //     url: '/pages/back_sand/back?id=2'
+    //   });
+    // }, 2500)
+    }
+  if (to_url != undefined) {
+    if (typeof to_url == 'object') {
+      var tab = to_url.tab || 1, url = to_url.url || '';
+      switch (tab) {
+        case 1:
+          //一定时间后跳转至 table
+          setTimeout(function () {
+            wx.switchTab({
+              url: url
+            })
+          }, endtime);
+          break;
+        case 2:
+          //跳转至非table页面
+          setTimeout(function () {
+            wx.navigateTo({
+              url: url,
+            })
+          }, endtime);
+          break;
+        case 3:
+          //返回上页面
+          setTimeout(function () {
+            wx.navigateBack({
+              delta: parseInt(url),
+            })
+          }, endtime);
+          break;
+        case 4:
+          //关闭当前所有页面跳转至非table页面
+          setTimeout(function () {
+            wx.reLaunch({
+              url: url,
+            })
+          }, endtime);
+          break;
+        case 5:
+          //关闭当前页面跳转至非table页面
+          setTimeout(function () {
+            wx.redirectTo({
+              url: url,
+            })
+          }, endtime);
+          break;
+      }
+
+    } else if (typeof to_url == 'function') {
+      setTimeout(function () {
+        to_url && to_url();
+      }, endtime);
+    } else {
+      //没有提示时跳转不延迟
+      setTimeout(function () {
+        wx.navigateTo({
+          url: to_url,
+        })
+      }, title ? endtime : 0);
+    }
+  }
+}
+
+module.exports = {
+  formatTime: formatTime,
+  formatTime1: formatTime1,
+  Tips: Tips,
+}

Разница между файлами не показана из-за своего большого размера
+ 2051 - 0
utils_sand/wxapp_rsa.js


Некоторые файлы не были показаны из-за большого количества измененных файлов