hrjy 2 anos atrás
commit
87103364c8
100 arquivos alterados com 3842 adições e 0 exclusões
  1. 10 0
      .bowerrc
  2. 13 0
      .env.sample
  3. 18 0
      .gitignore
  4. 191 0
      LICENSE
  5. 12 0
      README.md
  6. 1 0
      addons/.gitkeep
  7. 340 0
      addons/AuthLoginWithWechatAndMobile-master/Addon.php
  8. BIN
      addons/AuthLoginWithWechatAndMobile-master/Install_Package/LoginWithMobileGet2.1.6.zip
  9. BIN
      addons/AuthLoginWithWechatAndMobile-master/Install_Package/LoginWithMobileGet2.1.7.zip
  10. BIN
      addons/AuthLoginWithWechatAndMobile-master/Install_Package/LoginWithMobileGet2.1.8.zip
  11. BIN
      addons/AuthLoginWithWechatAndMobile-master/Install_Package/LoginWithMobileGet2.1.9.zip
  12. BIN
      addons/AuthLoginWithWechatAndMobile-master/Install_Package/LoginWithMobileGet2.2.0.zip
  13. 201 0
      addons/AuthLoginWithWechatAndMobile-master/LICENSE
  14. 48 0
      addons/AuthLoginWithWechatAndMobile-master/Loginmobile.php
  15. 319 0
      addons/AuthLoginWithWechatAndMobile-master/README.md
  16. 189 0
      addons/AuthLoginWithWechatAndMobile-master/application/api/controller/AuthLoginWithWechat.php
  17. 14 0
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/.gitignore
  18. 14 0
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/app.js
  19. 19 0
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/app.json
  20. 330 0
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/app.wxss
  21. 16 0
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/pages/Authorize/Authorize.js
  22. 3 0
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/pages/Authorize/Authorize.json
  23. 13 0
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/pages/Authorize/Authorize.wxml
  24. 8 0
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/pages/Authorize/Authorize.wxss
  25. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/pages/Authorize/img/ico-homeon.png
  26. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/pages/Authorize/img/logo.png
  27. 218 0
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/pages/index/index.js
  28. 5 0
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/pages/index/index.json
  29. 23 0
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/pages/index/index.wxml
  30. 28 0
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/pages/index/index.wxss
  31. 69 0
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/project.config.json
  32. 7 0
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/sitemap.json
  33. 260 0
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/utils/Promise.js
  34. 67 0
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/utils/api.js
  35. 55 0
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/utils/countDown.js
  36. 1131 0
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/utils/es6-promise.auto.js
  37. 99 0
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/utils/js.js
  38. 121 0
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/utils/util.js
  39. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/00.gif
  40. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/01.gif
  41. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/02.gif
  42. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/03.gif
  43. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/04.gif
  44. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/05.gif
  45. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/06.gif
  46. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/07.gif
  47. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/08.gif
  48. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/09.gif
  49. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/10.gif
  50. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/100.gif
  51. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/101.gif
  52. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/102.gif
  53. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/103.gif
  54. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/104.gif
  55. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/105.gif
  56. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/106.gif
  57. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/107.gif
  58. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/108.gif
  59. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/109.gif
  60. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/11.gif
  61. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/110.gif
  62. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/111.gif
  63. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/112.gif
  64. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/113.gif
  65. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/114.gif
  66. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/115.gif
  67. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/116.gif
  68. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/117.gif
  69. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/118.gif
  70. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/119.gif
  71. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/12.gif
  72. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/120.gif
  73. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/121.gif
  74. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/122.gif
  75. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/123.gif
  76. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/124.gif
  77. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/125.gif
  78. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/126.gif
  79. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/127.gif
  80. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/128.gif
  81. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/129.gif
  82. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/13.gif
  83. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/130.gif
  84. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/131.gif
  85. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/132.gif
  86. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/133.gif
  87. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/134.gif
  88. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/14.gif
  89. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/15.gif
  90. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/16.gif
  91. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/17.gif
  92. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/18.gif
  93. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/19.gif
  94. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/20.gif
  95. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/21.gif
  96. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/22.gif
  97. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/23.gif
  98. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/24.gif
  99. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/25.gif
  100. BIN
      addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/26.gif

+ 10 - 0
.bowerrc

@@ -0,0 +1,10 @@
+{
+  "directory": "public/assets/libs",
+  "ignoredDependencies": [
+    "es6-promise",
+    "file-saver",
+    "html2canvas",
+    "jspdf",
+    "jspdf-autotable"
+  ]
+}

+ 13 - 0
.env.sample

@@ -0,0 +1,13 @@
+[app]
+debug = false
+trace = false
+dev = false
+sms_dev = false
+
+[database]
+hostname = 127.0.0.1
+database = xin
+username = xin
+password = ELHMMLrsZEXZJpTa
+hostport = 3306
+prefix = fa_

+ 18 - 0
.gitignore

@@ -0,0 +1,18 @@
+/nbproject/
+/runtime/*
+/public/uploads/*
+/public/.htaccess
+/public/*.htaccess
+.htaccess
+/public/.user.ini
+/public/h5/
+.idea
+vendor/
+thinkphp/
+composer.lock
+*.log
+*.css.map
+!.gitkeep
+.env
+.svn
+.vscode

+ 191 - 0
LICENSE

@@ -0,0 +1,191 @@
+Apache License
+Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and
+distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright
+owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities
+that control, are controlled by, or are under common control with that entity.
+For the purposes of this definition, "control" means (i) the power, direct or
+indirect, to cause the direction or management of such entity, whether by
+contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
+outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising
+permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including
+but not limited to software source code, documentation source, and configuration
+files.
+
+"Object" form shall mean any form resulting from mechanical transformation or
+translation of a Source form, including but not limited to compiled object code,
+generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made
+available under the License, as indicated by a copyright notice that is included
+in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that
+is based on (or derived from) the Work and for which the editorial revisions,
+annotations, elaborations, or other modifications represent, as a whole, an
+original work of authorship. For the purposes of this License, Derivative Works
+shall not include works that remain separable from, or merely link (or bind by
+name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version
+of the Work and any modifications or additions to that Work or Derivative Works
+thereof, that is intentionally submitted to Licensor for inclusion in the Work
+by the copyright owner or by an individual or Legal Entity authorized to submit
+on behalf of the copyright owner. For the purposes of this definition,
+"submitted" means any form of electronic, verbal, or written communication sent
+to the Licensor or its representatives, including but not limited to
+communication on electronic mailing lists, source code control systems, and
+issue tracking systems that are managed by, or on behalf of, the Licensor for
+the purpose of discussing and improving the Work, but excluding communication
+that is conspicuously marked or otherwise designated in writing by the copyright
+owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
+of whom a Contribution has been received by Licensor and subsequently
+incorporated within the Work.
+
+2. Grant of Copyright License.
+
+Subject to the terms and conditions of this License, each Contributor hereby
+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
+irrevocable copyright license to reproduce, prepare Derivative Works of,
+publicly display, publicly perform, sublicense, and distribute the Work and such
+Derivative Works in Source or Object form.
+
+3. Grant of Patent License.
+
+Subject to the terms and conditions of this License, each Contributor hereby
+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
+irrevocable (except as stated in this section) patent license to make, have
+made, use, offer to sell, sell, import, and otherwise transfer the Work, where
+such license applies only to those patent claims licensable by such Contributor
+that are necessarily infringed by their Contribution(s) alone or by combination
+of their Contribution(s) with the Work to which such Contribution(s) was
+submitted. If You institute patent litigation against any entity (including a
+cross-claim or counterclaim in a lawsuit) alleging that the Work or a
+Contribution incorporated within the Work constitutes direct or contributory
+patent infringement, then any patent licenses granted to You under this License
+for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution.
+
+You may reproduce and distribute copies of the Work or Derivative Works thereof
+in any medium, with or without modifications, and in Source or Object form,
+provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of
+this License; and
+You must cause any modified files to carry prominent notices stating that You
+changed the files; and
+You must retain, in the Source form of any Derivative Works that You distribute,
+all copyright, patent, trademark, and attribution notices from the Source form
+of the Work, excluding those notices that do not pertain to any part of the
+Derivative Works; and
+If the Work includes a "NOTICE" text file as part of its distribution, then any
+Derivative Works that You distribute must include a readable copy of the
+attribution notices contained within such NOTICE file, excluding those notices
+that do not pertain to any part of the Derivative Works, in at least one of the
+following places: within a NOTICE text file distributed as part of the
+Derivative Works; within the Source form or documentation, if provided along
+with the Derivative Works; or, within a display generated by the Derivative
+Works, if and wherever such third-party notices normally appear. The contents of
+the NOTICE file are for informational purposes only and do not modify the
+License. You may add Your own attribution notices within Derivative Works that
+You distribute, alongside or as an addendum to the NOTICE text from the Work,
+provided that such additional attribution notices cannot be construed as
+modifying the License.
+You may add Your own copyright statement to Your modifications and may provide
+additional or different license terms and conditions for use, reproduction, or
+distribution of Your modifications, or for any such Derivative Works as a whole,
+provided Your use, reproduction, and distribution of the Work otherwise complies
+with the conditions stated in this License.
+
+5. Submission of Contributions.
+
+Unless You explicitly state otherwise, any Contribution intentionally submitted
+for inclusion in the Work by You to the Licensor shall be under the terms and
+conditions of this License, without any additional terms or conditions.
+Notwithstanding the above, nothing herein shall supersede or modify the terms of
+any separate license agreement you may have executed with Licensor regarding
+such Contributions.
+
+6. Trademarks.
+
+This License does not grant permission to use the trade names, trademarks,
+service marks, or product names of the Licensor, except as required for
+reasonable and customary use in describing the origin of the Work and
+reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty.
+
+Unless required by applicable law or agreed to in writing, Licensor provides the
+Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
+including, without limitation, any warranties or conditions of TITLE,
+NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
+solely responsible for determining the appropriateness of using or
+redistributing the Work and assume any risks associated with Your exercise of
+permissions under this License.
+
+8. Limitation of Liability.
+
+In no event and under no legal theory, whether in tort (including negligence),
+contract, or otherwise, unless required by applicable law (such as deliberate
+and grossly negligent acts) or agreed to in writing, shall any Contributor be
+liable to You for damages, including any direct, indirect, special, incidental,
+or consequential damages of any character arising as a result of this License or
+out of the use or inability to use the Work (including but not limited to
+damages for loss of goodwill, work stoppage, computer failure or malfunction, or
+any and all other commercial damages or losses), even if such Contributor has
+been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability.
+
+While redistributing the Work or Derivative Works thereof, You may choose to
+offer, and charge a fee for, acceptance of support, warranty, indemnity, or
+other liability obligations and/or rights consistent with this License. However,
+in accepting such obligations, You may act only on Your own behalf and on Your
+sole responsibility, not on behalf of any other Contributor, and only if You
+agree to indemnify, defend, and hold each Contributor harmless for any liability
+incurred by, or claims asserted against, such Contributor by reason of your
+accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work
+
+To apply the Apache License to your work, attach the following boilerplate
+notice, with the fields enclosed by brackets "{}" replaced with your own
+identifying information. (Don't include the brackets!) The text should be
+enclosed in the appropriate comment syntax for the file format. We also
+recommend that a file or class name and description of purpose be included on
+the same "printed page" as the copyright notice for easier identification within
+third-party archives.
+
+   Copyright 2017 Karson
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

+ 12 - 0
README.md

@@ -0,0 +1,12 @@
+# H5盲盒
+
+## 开发说明
+1. 插件化配置,需要开发人员开启dev环境后访问插件地址进行配置
+    - 短信宝
+    - 支付宝 - 微信支付宝整合插件
+    - 微信支付 - 微信支付宝整合插件
+2. 业务补充
+    - 邀请奖励:application/api/behavior/InviteSuccess.php
+    - 公众号登录:配置wechat表appid、appsecret字段
+    - 节点安全:强烈建议关闭dev!关闭后将禁止访问auth_rule表未记录或状态为hidden或父级状态为hidden的节点
+    - 短信:env.sms_dev可配置是否模拟短信

+ 1 - 0
addons/.gitkeep

@@ -0,0 +1 @@
+

+ 340 - 0
addons/AuthLoginWithWechatAndMobile-master/Addon.php

@@ -0,0 +1,340 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\common\controller\Backend;
+use fast\Http;
+use think\addons\AddonException;
+use think\addons\Service;
+use think\Cache;
+use think\Config;
+use think\Exception;
+
+/**
+ * 插件管理
+ *
+ * @icon   fa fa-cube
+ * @remark 可在线安装、卸载、禁用、启用插件,同时支持添加本地插件。FastAdmin已上线插件商店 ,你可以发布你的免费或付费插件:<a href="https://www.fastadmin.net/store.html" target="_blank">https://www.fastadmin.net/store.html</a>
+ */
+class Addon extends Backend
+{
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+    }
+
+    /**
+     * 查看
+     */
+    public function index()
+    {
+        $addons = get_addon_list();
+        foreach ($addons as $k => &$v) {
+            $config = get_addon_config($v['name']);
+            $v['config'] = $config ? 1 : 0;
+            $v['url'] = str_replace($this->request->server('SCRIPT_NAME'), '', $v['url']);
+        }
+        $this->assignconfig(['addons' => $addons]);
+        return $this->view->fetch();
+    }
+
+    /**
+     * 配置
+     */
+    public function config($ids = null)
+    {
+        $name = $this->request->get("name");
+        if (!$name) {
+            $this->error(__('Parameter %s can not be empty', $ids ? 'id' : 'name'));
+        }
+        if (!is_dir(ADDON_PATH . $name)) {
+            $this->error(__('Directory not found'));
+        }
+        $info = get_addon_info($name);
+        $config = get_addon_fullconfig($name);
+        if (!$info) {
+            $this->error(__('No Results were found'));
+        }
+        if ($this->request->isPost()) {
+            $params = $this->request->post("row/a");
+            if ($params) {
+                foreach ($config as $k => &$v) {
+                    if (isset($params[$v['name']])) {
+                        if ($v['type'] == 'array') {
+                            $params[$v['name']] = is_array($params[$v['name']]) ? $params[$v['name']] : (array)json_decode($params[$v['name']], true);
+                            $value = $params[$v['name']];
+                        } else {
+                            $value = is_array($params[$v['name']]) ? implode(',', $params[$v['name']]) : $params[$v['name']];
+                        }
+                        $v['value'] = $value;
+                    }
+                }
+                try {
+                    //更新配置文件
+                    set_addon_fullconfig($name, $config);
+                    Service::refresh();
+                    $this->success();
+                } catch (Exception $e) {
+                    $this->error(__($e->getMessage()));
+                }
+            }
+            $this->error(__('Parameter %s can not be empty', ''));
+        }
+        $tips = [];
+        foreach ($config as $index => &$item) {
+            if ($item['name'] == '__tips__') {
+                $tips = $item;
+                unset($config[$index]);
+            }
+        }
+        $this->view->assign("addon", ['info' => $info, 'config' => $config, 'tips' => $tips]);
+        $configFile = ADDON_PATH . $name . DS . 'config.html';
+        $viewFile = is_file($configFile) ? $configFile : '';
+        return $this->view->fetch($viewFile);
+    }
+
+    /**
+     * 安装
+     */
+    public function install()
+    {
+        $name = $this->request->post("name");
+        $force = (int)$this->request->post("force");
+        if (!$name) {
+            $this->error(__('Parameter %s can not be empty', 'name'));
+        }
+        try {
+            $uid = $this->request->post("uid");
+            $token = $this->request->post("token");
+            $version = $this->request->post("version");
+            $faversion = $this->request->post("faversion");
+            $extend = [
+                'uid'       => $uid,
+                'token'     => $token,
+                'version'   => $version,
+                'faversion' => $faversion
+            ];
+            Service::install($name, $force, $extend);
+            $info = get_addon_info($name);
+            $info['config'] = get_addon_config($name) ? 1 : 0;
+            $info['state'] = 1;
+            $this->success(__('Install successful'), null, ['addon' => $info]);
+        } catch (AddonException $e) {
+            $this->result($e->getData(), $e->getCode(), __($e->getMessage()));
+        } catch (Exception $e) {
+            $this->error(__($e->getMessage()), $e->getCode());
+        }
+    }
+
+    /**
+     * 卸载
+     */
+    public function uninstall()
+    {
+        $name = $this->request->post("name");
+        $force = (int)$this->request->post("force");
+        if (!$name) {
+            $this->error(__('Parameter %s can not be empty', 'name'));
+        }
+        try {
+            Service::uninstall($name, $force);
+            $this->success(__('Uninstall successful'));
+        } catch (AddonException $e) {
+            $this->result($e->getData(), $e->getCode(), __($e->getMessage()));
+        } catch (Exception $e) {
+            $this->error(__($e->getMessage()));
+        }
+    }
+
+    /**
+     * 禁用启用
+     */
+    public function state()
+    {
+        $name = $this->request->post("name");
+        $action = $this->request->post("action");
+        $force = (int)$this->request->post("force");
+        if (!$name) {
+            $this->error(__('Parameter %s can not be empty', 'name'));
+        }
+        try {
+            $action = $action == 'enable' ? $action : 'disable';
+            //调用启用、禁用的方法
+            Service::$action($name, $force);
+            Cache::rm('__menu__');
+            $this->success(__('Operate successful'));
+        } catch (AddonException $e) {
+            $this->result($e->getData(), $e->getCode(), __($e->getMessage()));
+        } catch (Exception $e) {
+            $this->error(__($e->getMessage()));
+        }
+    }
+
+    /**
+     * 本地上传
+     */
+    public function local()
+    {
+        Config::set('default_return_type', 'json');
+
+        $file = $this->request->file('file');
+        $addonTmpDir = RUNTIME_PATH . 'addons' . DS;
+        if (!is_dir($addonTmpDir)) {
+            @mkdir($addonTmpDir, 0755, true);
+        }
+        $info = $file->rule('uniqid')->validate(['size' => 10240000, 'ext' => 'zip'])->move($addonTmpDir);
+        if ($info) {
+            $tmpName = substr($info->getFilename(), 0, stripos($info->getFilename(), '.'));
+            $tmpAddonDir = ADDON_PATH . $tmpName . DS;
+            $tmpFile = $addonTmpDir . $info->getSaveName();
+            try {
+                Service::unzip($tmpName);
+                @unlink($tmpFile);
+                $infoFile = $tmpAddonDir . 'info.ini';
+                if (!is_file($infoFile)) {
+                    throw new Exception(__('Addon info file was not found'));
+                }
+
+                $config = Config::parse($infoFile, '', $tmpName);
+                $name = isset($config['name']) ? $config['name'] : '';
+                if (!$name) {
+                    throw new Exception(__('Addon info file data incorrect'));
+                }
+
+                $newAddonDir = ADDON_PATH . $name . DS;
+                if (is_dir($newAddonDir)) {
+                    throw new Exception(__('Addon already exists'));
+                }
+
+                //重命名插件文件夹
+                rename($tmpAddonDir, $newAddonDir);
+                try {
+                    //默认禁用该插件
+                    $info = get_addon_info($name);
+                    if ($info['state']) {
+                        $info['state'] = 0;
+                        set_addon_info($name, $info);
+                    }
+
+                    //执行插件的安装方法
+                    $class = get_addon_class($name);
+                    if (class_exists($class)) {
+                        $addon = new $class();
+                        $addon->install();
+                    }
+
+                    //导入SQL
+                    Service::importsql($name);
+
+                    $info['config'] = get_addon_config($name) ? 1 : 0;
+                    $this->success(__('Offline installed tips'), null, ['addon' => $info]);
+                } catch (Exception $e) {
+                    @rmdirs($newAddonDir);
+                    throw new Exception(__($e->getMessage()));
+                }
+            } catch (Exception $e) {
+                @unlink($tmpFile);
+                @rmdirs($tmpAddonDir);
+                $this->error(__($e->getMessage()));
+            }
+        } else {
+            // 上传失败获取错误信息
+            $this->error(__($file->getError()));
+        }
+    }
+
+    /**
+     * 更新插件
+     */
+    public function upgrade()
+    {
+        $name = $this->request->post("name");
+        if (!$name) {
+            $this->error(__('Parameter %s can not be empty', 'name'));
+        }
+        try {
+            $uid = $this->request->post("uid");
+            $token = $this->request->post("token");
+            $version = $this->request->post("version");
+            $faversion = $this->request->post("faversion");
+            $extend = [
+                'uid'       => $uid,
+                'token'     => $token,
+                'version'   => $version,
+                'faversion' => $faversion
+            ];
+            //调用更新的方法
+            Service::upgrade($name, $extend);
+            Cache::rm('__menu__');
+            $this->success(__('Operate successful'));
+        } catch (AddonException $e) {
+            $this->result($e->getData(), $e->getCode(), __($e->getMessage()));
+        } catch (Exception $e) {
+            $this->error(__($e->getMessage()));
+        }
+    }
+
+    /**
+     * 已装插件
+     */
+    public function downloaded()
+    {
+        $offset = (int)$this->request->get("offset");
+        $limit = (int)$this->request->get("limit");
+        $filter = $this->request->get("filter");
+        $search = $this->request->get("search");
+        $search = htmlspecialchars(strip_tags($search));
+        $onlineaddons = Cache::get("onlineaddons");
+        if (!is_array($onlineaddons)) {
+            $onlineaddons = [];
+            $result = Http::sendRequest(config('fastadmin.api_url') . '/addon/index');
+            if ($result['ret']) {
+                $json = (array)json_decode($result['msg'], true);
+                $rows = isset($json['rows']) ? $json['rows'] : [];
+                foreach ($rows as $index => $row) {
+                    $onlineaddons[$row['name']] = $row;
+                }
+            }
+            Cache::set("onlineaddons", $onlineaddons, 600);
+        }
+        $filter = (array)json_decode($filter, true);
+        $addons = get_addon_list();
+        $list = [];
+        foreach ($addons as $k => $v) {
+            if ($search && stripos($v['name'], $search) === false && stripos($v['intro'], $search) === false) {
+                continue;
+            }
+
+            if (isset($onlineaddons[$v['name']])) {
+                $v = array_merge($v, $onlineaddons[$v['name']]);
+            } else {
+                $v['category_id'] = 0;
+                $v['flag'] = '';
+                $v['banner'] = '';
+                $v['image'] = '';
+                $v['donateimage'] = '';
+                $v['demourl'] = '';
+                $v['price'] = __('None');
+                $v['screenshots'] = [];
+                $v['releaselist'] = [];
+            }
+            $v['url'] = addon_url($v['name']);
+            $v['url'] = str_replace($this->request->server('SCRIPT_NAME'), '', $v['url']);
+            $v['createtime'] = filemtime(ADDON_PATH . $v['name']);
+            if ($filter && isset($filter['category_id']) && is_numeric($filter['category_id']) && $filter['category_id'] != $v['category_id']) {
+                continue;
+            }
+            $list[] = $v;
+        }
+        $total = count($list);
+        if ($limit) {
+            $list = array_slice($list, $offset, $limit);
+        }
+        $result = array("total" => $total, "rows" => $list);
+
+        $callback = $this->request->get('callback') ? "jsonp" : "json";
+        return $callback($result);
+    }
+}

BIN
addons/AuthLoginWithWechatAndMobile-master/Install_Package/LoginWithMobileGet2.1.6.zip


BIN
addons/AuthLoginWithWechatAndMobile-master/Install_Package/LoginWithMobileGet2.1.7.zip


BIN
addons/AuthLoginWithWechatAndMobile-master/Install_Package/LoginWithMobileGet2.1.8.zip


BIN
addons/AuthLoginWithWechatAndMobile-master/Install_Package/LoginWithMobileGet2.1.9.zip


BIN
addons/AuthLoginWithWechatAndMobile-master/Install_Package/LoginWithMobileGet2.2.0.zip


+ 201 - 0
addons/AuthLoginWithWechatAndMobile-master/LICENSE

@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

+ 48 - 0
addons/AuthLoginWithWechatAndMobile-master/Loginmobile.php

@@ -0,0 +1,48 @@
+<?php
+
+namespace addons\loginmobile;
+
+use app\common\library\Menu;
+use think\Addons;
+
+/**
+ * 插件
+ */
+class Loginmobile extends Addons
+{
+
+    /**
+     * 插件安装方法(只需要安装用户表即可)
+     * @return bool
+     */
+    public function install()
+    {
+        return true;
+    }
+
+    /**
+     * 插件卸载方法
+     * @return bool
+     */
+    public function uninstall()
+    {
+        return true;
+    }
+
+    /**
+     * 插件启用方法
+     */
+    public function enable()
+    {
+        return true;
+    }
+
+    /**
+     * 插件禁用方法
+     */
+    public function disable()
+    {
+        return true;
+    }
+
+}

+ 319 - 0
addons/AuthLoginWithWechatAndMobile-master/README.md

@@ -0,0 +1,319 @@
+#  Fastadmin微信小程序授权登录插件+手机号码获取
+
+## 2021.06.23更新(此更新明文传输数据时候对头像昵称的限制去掉了,因为部分用户存在头像昵称异常的情况导致不能使用小程序,):
+## 2021.06.15更新(此更新仅在markdown补充,不改动插件代码,自行复制下面代码添加即可 )-由于授权登录可能存在解密失败的情况,特新加明文传输API,接口代码如下:
+
+
+```
+protected $noNeedLogin = ['code', 'login', 'codev2', 'loginv2'];
+
+   /**
+     * 登录第一步,获取openid 跟 session_key
+     */
+    public function codev2()
+    {
+        $code = $this->request->param('code');
+        if (!$code) {
+            $this->error('code不能为空');
+        }
+        self::getOpenidv2($code);
+    }
+
+
+    /**
+     * @param $code 用来交换获取openid 跟 session_key
+     */
+    public function getOpenidv2($code)
+    {
+        $url = sprintf($this->loginUrl, $this->appid, $this->secret, $code);
+        $result = Http::get($url);
+        $wxResult = json_decode($result, true);
+        if (empty($wxResult)) {
+            $this->error('获取sessin_key及openID时异常');
+        }
+        if (isset($wxResult['errcode']) && $wxResult['errcode'] != 0) {
+            $this->error($wxResult['errmsg']);
+        }
+        $item = [
+            'openid' => $wxResult['openid'],
+            'session_key' => $wxResult['session_key']
+        ];
+        $ck = \app\admin\model\User::where(['openid' => $wxResult['openid']])->find();
+        if (!$ck) {
+            $user = new \app\admin\model\User;
+            $user->openid = $wxResult['openid'];
+            $user->status = 'normal';
+            $user->save();
+            $this->auth->direct($user->id);
+            $this->success('登录成功', $this->auth->getUserinfo());
+        } else {
+            $this->auth->direct($ck['id']);
+            $this->success('登录成功', $this->auth->getUserinfo());
+        }
+    }
+
+
+    /**
+     * 用户登录
+     */
+    public function loginv2()
+    {
+        $nickName = $this->request->post('nickName');
+        $avatarUrl = $this->request->post('avatarUrl');
+        $gender = $this->request->post('gender');
+        $openid = $this->request->post('openid');
+        /**TODO 这个限制不能再用了    if (empty($nickName) || empty($avatarUrl) || empty($gender) || empty($openid)) {
+            $this->error('缺少参数');
+        }*/
+        $userinfo = \app\admin\model\User::where(['openid' => $openid])->find();
+        if ($userinfo) {
+            $userinfo->nickname = $nickName;
+            $userinfo->avatar = $avatarUrl;
+            $userinfo->gender = $gender;
+            $userinfo->save();
+            $this->auth->direct($userinfo['id']);
+        } else {
+            $user = new \app\admin\model\User();
+            $user->data([
+                'nickname' => $nickName,
+                'avatar' => $avatarUrl,
+                'gender' => $gender,
+                'status' => 'normal',
+                'openid' => $openid
+            ]);
+            $user->save();
+            $this->auth->direct($user->id);
+        }
+        $this->success('登录成功', $this->auth->getUserinfo());
+    }
+
+```
+
+
+
+
+#### 介绍
+> 旨在方便自己日后做这方面的开发,直接安装就好,省事.本项目是基于2021年4月13日微信小程序授权登录做的整改进行开发的插件
+
+#### 软件架构
+
+> 毫无架构可言
+
+
+#### 使用说明
+
+1.  Install_Package目录 是打包过的插件安装包,可以直接用于安装
+2.  接口文档在下方已经贴出
+3.  前端测试demo:在application/api/minapp_v2 里面,使用时只需要修改minapp_v2/utils/api.js 里面的 http地址即可
+4.  使用前还记得要把插件管理里面的配置项的小程appid跟密钥配置好
+
+![输入图片说明](https://images.gitee.com/uploads/images/2021/0416/112431_447b3d59_968332.png "屏幕截图.png")
+#### 参与贡献
+
+1.  Fork 本仓库
+2.  新建 Feat_xxx 分支
+3.  提交代码
+4.  新建 Pull Request
+
+
+![输入图片说明](https://images.gitee.com/uploads/images/2021/0416/191030_13c98f4a_968332.png "屏幕截图.png")
+![输入图片说明](https://images.gitee.com/uploads/images/2021/0416/191428_64408157_968332.png "屏幕截图.png")
+
+
+
+## 下面是API文档
+
+##### API一简要描述
+
+- code换取openid接口
+
+##### 请求URL
+- `/api/Auth_login_with_wechat/code`
+
+##### 请求方式
+- GET/POST
+
+##### 参数
+
+|参数名|必选|类型|说明|
+|:----    |:---|:----- |-----   |
+|code |是  |int |wx.login 获取的code   |
+
+##### 返回示例
+
+``` 
+{
+    "code": 1,
+    "msg": "成功",
+    "time": "1618534098",
+    "data": {
+        "openid": "o5rIS5MzaMjZBz3DMzUtsosMZApU",
+        "session_key": "z5kYsGmcb7MaRcS0a1AGPQ=="
+    }
+}
+
+{
+    "code": 0,
+    "msg": "code been used, hints: [ req_id: YDHBA5yFe-i1q0RA ]",
+    "time": "1618534253",
+    "data": null
+}
+```
+
+##### 返回参数说明
+
+|参数名|类型|说明|
+|:-----  |:-----|-----                           |
+|code |int   |状态码,1:成功;0:失败  |
+|msg |string   |提示语  |
+|openid |string   |openid  用于后面的登录传值 |
+|session_key |string   |session_key 用于后面的登录传值 |
+
+
+
+
+
+
+##### API二简要描述
+
+- 登录接口
+
+##### 请求URL
+- `/api/Auth_login_with_wechat/login`
+
+##### 请求方式
+- POST
+
+##### 参数
+
+|参数名|必选|类型|说明|
+|:----    |:---|:----- |-----   |
+|encryptedData |是  |string |加密串   |
+|iv |是  |string |偏移量   |
+|sessionKey |是  |string |sessionKey   |
+|openid |是  |string |openid   |
+
+##### 返回示例
+
+``` 
+{
+    "code": 1,
+    "msg": "登录成功",
+    "time": "1618535634",
+    "data": {
+        "id": 2,
+        "username": "",
+        "nickname": "Blustant'C 吴伟祥 可乐爸爸",
+        "mobile": "",
+        "avatar": "https://thirdwx.qlogo.cn/mmopen/vi_32/Hlq7zKcsbIXveqiaEuRI6SHbk1zSBADsf6SVMWI9VxRxmpz4R917QHfcFTlsLFC8IVhZ418LVlv3DX4VjzyKibZg/132",
+        "score": 0,
+        "token": "47b64df8-d5ee-43e7-9168-889ea48c11fb",
+        "user_id": 2,
+        "createtime": 1618535634,
+        "expiretime": 1621127634,
+        "expires_in": 2592000
+    }
+}
+```
+
+##### 返回参数说明
+
+|参数名|类型|说明|
+|:-----  |:-----|-----                           |
+|code |int   |状态码,1:成功;0:失败  |
+|msg |string   |提示语  |
+|token |string   |用于接口请求使用  |
+
+
+
+
+
+##### API三简要描述
+
+- 获取手机号接口
+
+##### 前端示例代码
+```html
+<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">获取手机号</button>
+
+
+getPhoneNumber:function(e){
+    console.log(e.detail.errMsg)
+    console.log(e.detail.iv)
+    console.log(e.detail.encryptedData)
+},
+```
+
+
+
+##### 请求URL
+- ` /api/Auth_login_with_wechat/getPhone`
+
+##### 请求方式
+- POST
+
+##### 参数
+
+|参数名|必选|类型|说明|
+|:----    |:---|:----- |-----   |
+|iv |是  |string |偏移量   |
+|encryptedData |是  |string | 加密串    |
+|sessionKey |是  |string | sessionKey    |
+
+##### 返回示例
+
+``` 
+{
+    "code": 1,
+    "msg": "获取成功",
+    "time": "1613125219",
+    "data": {
+        "phoneNumber": "18712377078",
+        "purePhoneNumber": "18712377078",
+        "countryCode": "86",
+        "watermark": {
+            "timestamp": 1613124456,
+            "appid": "wxc17d20f5b4595397"
+        }
+    }
+}
+```
+
+##### 返回参数说明
+
+|参数名|类型|说明|
+|:-----  |:-----|-----                           |
+|code |int   |1  成功  0 失败 -获取手机号失败就只能手动填写手机号 |
+|data-phoneNumber |string   |手机号  |
+
+
+
+
+
+
+> 解密后的数据格式,并没有openid跟unionID
+
+```angular2html
+{
+    "nickName":"Blustant'C 吴伟祥 可乐爸爸",
+    "gender":1,
+    "language":"zh_CN",
+    "city":"Hefei",
+    "province":"Anhui",
+    "country":"China",
+    "avatarUrl":"https://thirdwx.qlogo.cn/mmopen/vi_32/Hlq7zKcsbIXveqiaEuRI6SHbk1zSBADsf6SVMWI9VxRxmpz4R917QHfcFTlsLFC8IVhZ418LVlv3DX4VjzyKibZg/132",
+    "watermark":{
+        "timestamp":1618498216,
+        "appid":"wx9d9766d500e04dcd"
+    }
+}
+```
+
+
+## 获取手机号遇到报错appid没有权限:
+
+![输入图片说明](https://images.gitee.com/uploads/images/2021/0421/164220_ea476bdc_968332.png "屏幕截图.png")
+
+- 解决方案:微信小程序后台首页的微信认证通过了就有权限了 
+![输入图片说明](https://images.gitee.com/uploads/images/2021/0421/164320_52f3b8e1_968332.png "屏幕截图.png")
+

+ 189 - 0
addons/AuthLoginWithWechatAndMobile-master/application/api/controller/AuthLoginWithWechat.php

@@ -0,0 +1,189 @@
+<?php
+/**
+ * Created by 老吴.
+ * UserMsg:砥砺前行,扬帆起航
+ * email:cwwx0128@qq.com
+ * QQ:1113249273
+ * QQ群:925283872
+ * 微信:cww0128
+ * Date: 2021/4/15
+ * Time: 23:08
+ */
+
+namespace app\api\controller;
+
+use addons\third\model\Third;
+use app\common\controller\Api;
+use fast\Http;
+
+class AuthLoginWithWechat extends Api
+{
+    protected $noNeedLogin = ['code', 'login'];
+    protected $noNeedRight = ['*'];
+    protected $appid;
+    protected $secret;
+    protected $loginUrl;
+
+    public function __construct()
+    {
+        $this->appid = get_addon_config("loginmobile")['appId'];
+        $this->secret = get_addon_config("loginmobile")['secretId'];
+        $this->loginUrl = get_addon_config("loginmobile")['loginUrl'];
+        parent::__construct();
+    }
+
+    //https://hongqi-b.maoln.com/api/Auth_login_with_wechat/test
+
+    /**
+     * 登录第一步,获取openid 跟 session_key
+     */
+    public function code()
+    {
+        $code = $this->request->param('code');
+        if (!$code) {
+            $this->error('code不能为空');
+        }
+        self::getOpenid($code);
+    }
+
+
+    /**
+     * @param $code 用来交换获取openid 跟 session_key
+     */
+    public function getOpenid($code)
+    {
+        $url = sprintf($this->loginUrl, $this->appid, $this->secret, $code);
+        $result = Http::get($url);
+        $wxResult = json_decode($result, true);
+        if (empty($wxResult)) {
+            $this->error('获取sessin_key及openID时异常');
+        }
+        if (isset($wxResult['errcode']) && $wxResult['errcode'] != 0) {
+            $this->error($wxResult['errmsg']);
+        }
+        $item = [
+            'openid' => $wxResult['openid'],
+            'session_key' => $wxResult['session_key']
+        ];
+        $this->success('成功', $item);
+    }
+
+
+    /**
+     * 用户登录
+     */
+    public function login()
+    {
+        $encryptedData = $this->request->post('encryptedData');
+        $iv = $this->request->post('iv');
+        $sessionKey = $this->request->post('sessionKey');
+        $openid = $this->request->post('openid');
+
+        if (empty($encryptedData) || empty($iv) || empty($sessionKey) || empty($openid)) {
+            $this->error('缺少参数');
+        }
+        $errCode = self::decryptData($encryptedData, $iv, $data, $sessionKey, $this->appid);
+        if ($errCode == 0) {
+            $result = json_decode($data, true);
+
+            $userinfo = \app\admin\model\User::where(['openid' => $openid])->find();
+
+//            $ah = new Auth();
+
+            if ($userinfo) {
+                $userinfo->nickname = $result['nickName'];
+                $userinfo->avatar = $result['avatarUrl'];
+                $userinfo->gender = $result['gender'];
+                $userinfo->city = $result['city'];
+                $userinfo->province = $result['province'];
+                $userinfo->country = $result['country'];
+                $userinfo->save();
+                $this->auth->direct($userinfo['id']);
+            } else {
+                $user = new \app\admin\model\User();
+                $user->data([
+                    'nickname' => $result['nickName'],
+                    'avatar' => $result['avatarUrl'],
+                    'gender' => $result['gender'],
+                    'city' => $result['city'],
+                    'province' => $result['province'],
+                    'country' => $result['country'],
+                    'status' => 'normal',
+                    'openid' => $openid
+                ]);
+                $user->save();
+                $this->auth->direct($user->id);
+            }
+            $this->success('登录成功', $this->auth->getUserinfo());
+        } else {
+            $this->error('登录失败' . $errCode);
+        }
+    }
+
+
+    /**
+     * 获取手机号
+     */
+    public function getPhone()
+    {
+        $iv = $this->request->post("iv", '', 'trim');
+        $encryptedData = $this->request->post("encryptedData", '', 'trim');
+        $sessionKey = $this->request->post('sessionKey');
+        $datainfo = $this->auth->getUserinfo();
+        if (!$iv || !$encryptedData) {
+            $this->error('传参有误');
+        }
+        $errCode = self::decryptData($encryptedData, $iv, $data, $sessionKey, $this->appid);
+        if ($errCode == 0) {
+            $result = json_decode($data, true);
+            if (isset($result['phoneNumber'])) {
+                $user = \app\admin\model\User::get($datainfo['id']);
+                $user->mobile = $result['phoneNumber'];
+                $user->save();
+                $this->success('获取成功', $result);
+            } else {
+                $this->error('号码获取失败');
+            }
+        } else {
+            $this->error('用户信息更新失败');
+        }
+    }
+
+    /**
+     * 检验数据的真实性,并且获取解密后的明文.
+     * @param $encryptedData string 加密的用户数据
+     * @param $iv string 与用户数据一同返回的初始向量
+     * @param $data string 解密后的原文
+     *
+     * @return int 成功0,失败返回对应的错误码
+     */
+    public function decryptData($encryptedData, $iv, &$data, $sessionKey, $appid)
+    {
+        if (strlen($sessionKey) != 24) {
+            return -41001;
+        }
+        $aesKey = base64_decode($sessionKey);
+
+
+        if (strlen($iv) != 24) {
+            return -41002;
+        }
+        $aesIV = base64_decode($iv);
+
+        $aesCipher = base64_decode($encryptedData);
+
+        $result = openssl_decrypt($aesCipher, "AES-128-CBC", $aesKey, 1, $aesIV);
+
+        $dataObj = json_decode($result);
+        if ($dataObj == NULL) {
+            return -41003;
+        }
+        if ($dataObj->watermark->appid != $appid) {
+            return -41003;
+        }
+        $data = $result;
+        return 0;
+    }
+
+
+}

+ 14 - 0
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/.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/

+ 14 - 0
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/app.js

@@ -0,0 +1,14 @@
+//app.js
+var _api = require('utils/api.js')
+var api = _api.api;
+const request = require('utils/js.js');
+App({
+
+  onLaunch: function (res) {
+    let that = this;
+   
+  },
+  globalData: {
+   
+  },
+})

+ 19 - 0
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/app.json

@@ -0,0 +1,19 @@
+{
+  "pages": [
+    "pages/index/index",
+    "pages/Authorize/Authorize"
+  ],
+  "window": {
+    "backgroundTextStyle": "dark",
+    "navigationBarBackgroundColor": "#28292D",
+    "navigationBarTitleText": "疫康",
+    "navigationBarTextStyle": "white"
+   
+  },
+  "permission": {
+    "scope.userLocation": {
+      "desc": "你的位置信息将用于小程序位置接口的效果展示"
+    }
+  },
+  "sitemapLocation": "sitemap.json"
+}

+ 330 - 0
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/app.wxss

@@ -0,0 +1,330 @@
+/* @import "/assets/iconfont/iconfont"; */
+page{font-size:26rpx;color:#000;background-color: #F7F7F7;padding-bottom:30rpx;position:relative}
+image {width: 100%;height: 100%;}
+.clear{ clear:both;overflow:hidden;}
+.clearfix{zoom:1;}
+.clearfix:before,.clearfix:after{display: table;line-height: 0;content:"";}
+.clearfix:after{clear:both;}
+image,view,text,input,button,page,form,textarea,navigator,scroll-view,cover-view,view::after,view::before{box-sizing:border-box;}
+form,textarea,input,button{font-size:26rpx;}
+.redcolor{color: #Ff0000}
+button{background:none;border-radius:0;padding:0;margin:0}
+button::after {border: 0rpx;}
+form{display:block;width:100%}
+.zIndex0{z-index:0}
+.loadd{padding:50rpx}
+.no{display:none}
+.tc{text-align:center}
+.tl{text-align:left}
+.tr{text-align:right}
+.fl{float:left}
+.fr{float:right}
+.text{display:block;width:100%}
+.clear{clear: both}
+.share-btn{position:absolute;width:100%;height:100%;left:0;top:0;z-index:980}
+.dd{position:relative}
+picker,.picker{position:absolute;width:100%;height:100%;left:0;top:0;z-index:20}
+
+.box{width:90% !important;margin-left:auto !important;margin-right:auto !important}
+.box1{width:95%;margin-left:auto !important;margin-right:auto !important}
+.paddLR{padding-left:5% !important;padding-right:5% !important;}
+.paddLR1{padding-left:2.5% !important;padding-right:2.5% !important;}
+.bk{display:block;}
+.inbk{display:inline-block;vertical-align:middle}
+.b{font-weight:bold}
+.re{position:relative}
+.ab{position:absolute}
+.fix{position:fixed}
+.ntit{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;}
+.np{overflow:hidden;}
+.clickshow{display:none;}
+.clickshow.active{display:block}
+
+/* 字体大小 */
+.font18{font-size:18rpx}.font19{font-size:19rpx}.font20{font-size:20rpx}.font21{font-size:21rpx}.font22{font-size:22rpx}.font23{font-size:23rpx}.font24{font-size:24rpx}.font25{font-size:25rpx}.font26{font-size:26rpx}.font27{font-size:27rpx}.font28{font-size:28rpx}.font29{font-size:29rpx}.font30{font-size:30rpx}.font31{font-size:31rpx}.font32{font-size:32rpx}.font33{font-size:33rpx}.font34{font-size:34rpx}.font35{font-size:35rpx}.font36{font-size:36rpx}.font37{font-size:37rpx}.font38{font-size:38rpx}.font39{font-size:39rpx}.font40{font-size:40rpx}.font41{font-size:41rpx}.font42{font-size:42rpx}.font43{font-size:43rpx}.font44{font-size:44rpx}.font45{font-size:45rpx}.font46{font-size:46rpx}.font47{font-size:47rpx}.font48{font-size:48rpx}.font49{font-size:49rpx}.font50{font-size:50rpx}.font51{font-size:51rpx}.font52{font-size:52rpx}.font53{font-size:53rpx}.font54{font-size:54rpx}.font55{font-size:55rpx}.font56{font-size:56rpx}.font57{font-size:57rpx}.font58{font-size:58rpx}.font59{font-size:59rpx}.font60{font-size:60rpx}.font61{font-size:61rpx}.font62{font-size:62rpx}.font63{font-size:63rpx}.font64{font-size:64rpx}.font65{font-size:65rpx}.font66{font-size:66rpx}.font67{font-size:67rpx}.font68{font-size:68rpx}.font69{font-size:69rpx}.font70{font-size:70rpx}.font71{font-size:71rpx}.font72{font-size:72rpx}.font73{font-size:73rpx}.font74{font-size:74rpx}.font75{font-size:75rpx}.font76{font-size:76rpx}.font77{font-size:77rpx}.font78{font-size:78rpx}.font79{font-size:79rpx}.font80{font-size:80rpx}
+/* 圆角 */
+.rd2{border-radius:2rpx;overflow:hidden}.rd3{border-radius:3rpx;overflow:hidden}.rd4{border-radius:4rpx;overflow:hidden}.rd5{border-radius:5rpx;overflow:hidden}.rd6{border-radius:6rpx;overflow:hidden}.rd7{border-radius:7rpx;overflow:hidden}.rd8{border-radius:8rpx;overflow:hidden}.rd9{border-radius:9rpx;overflow:hidden}.rd10{border-radius:10rpx;overflow:hidden}.rd15{border-radius:15rpx;overflow:hidden}.rd20{border-radius:20rpx;overflow:hidden}.rd25{border-radius:25rpx;overflow:hidden}.rd30{border-radius:30rpx;overflow:hidden}.rd35{border-radius:35rpx;overflow:hidden}.rd40{border-radius:40rpx;overflow:hidden}.rd45{border-radius:45rpx;overflow:hidden}.rd50{border-radius:50%;overflow:hidden}
+/* 图标大小 */
+.ico15{width:15rpx;height:15rpx;}.ico20{width:20rpx;height:20rpx;}.ico25{width:25rpx;height:25rpx;}.ico30{width:30rpx;height:30rpx;}.ico35{width:35rpx;height:35rpx;}.ico40{width:40rpx;height:40rpx;}.ico45{width:45rpx;height:45rpx;}.ico50{width:50rpx;height:50rpx;}.ico55{width:55rpx;height:55rpx;}.ico60{width:60rpx;height:60rpx;}.ico65{width:65rpx;height:65rpx;}.ico70{width:70rpx;height:70rpx;}.ico75{width:75rpx;height:75rpx;}.ico80{width:80rpx;height:80rpx;}.ico85{width:85rpx;height:85rpx;}.ico90{width:90rpx;height:90rpx;}.ico95{width:95rpx;height:95rpx;}.ico100{width:100rpx;height:100rpx;}
+/* 弹性布局 */
+.flex-le{display:flex !important;justify-content:flex-start;}
+.flex-lect{display:flex !important;justify-content:flex-start;align-items:center}
+.flex-be{display:flex !important;justify-content:space-between;}
+.flex-bect{display:flex !important;justify-content:space-between;align-items:center}
+.flex-ct{display:flex !important;justify-content:center;align-items:center}
+.flex-rict{display:flex !important;justify-content:flex-end;align-items:center}
+
+.hh{flex-wrap:wrap}/* 换行 */
+.dhh{flex-wrap:wrap-reverse}/* 换行,第一行在下方 */
+.bhh{flex-wrap:nowrap}/* 不换行 */
+/*底部loading加载 */
+.noMore{text-align:center;color:#666;padding:15rpx 0 30rpx}
+.loading-img{width:200rpx;background-color:rgba(0,0,0,0.5);position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);text-align:center;color:#fff;padding:50rpx 0}
+.load-box{width: 100%;text-align: center;padding:10rpx 0 20rpx;}
+.load-box .Ldd{width: 20rpx;height: 20rpx;background: #999;border-radius: 50%;margin-left: 15rpx;display: inline-block;-webkit-animation: dd 1s linear infinite alternate;animation: dd 1s linear infinite alternate;}
+.load-box .Ldd:nth-child(1){animation-delay: 0s;}
+.load-box .Ldd:nth-child(2){animation-delay: 0.5s;}
+.load-box .Ldd:nth-child(3){animation-delay: 1s;}
+.load-box .Ldd:nth-child(4){animation-delay: 1.5s;}
+@-webkit-keyframes dd {0% {transform: scale(1);}100% {transform: scale(0);}}
+@keyframes dd {0% {transform: scale(1);}100% {transform: scale(0);}}
+
+
+
+/* 颜色 */
+.h00{color:#000}
+.h33{color:#333 !important}
+.h55{color:#555}
+.h45{color:#454545}
+.h66{color:#666}
+.h77{color:#777}
+.h81{color:#818181}
+.h88{color:#888}
+.h99{color:#999}
+.h96{color:#969696}
+.hb1{color:#B1B1B1}
+.hee{color:#eeeeee}
+.hb0{color:#b0b0b0}
+.redff{color:#fff;}
+.red0{color:#FD0000}
+.red1{color:#58D0C5}
+.red2{color:#236DDD}
+.red3{color:#40d9ff}
+.red4{color:#02a61e}
+.red5{color:#599ded}
+.bgff{background-color:#fff !important;}
+.bg0{background-color:#FD0000 !important;color:#fff !important;}
+.bg1{background-color:#2883FE !important;color:#fff !important;}
+.bg2{background-color:#FF7E11 !important;color:#fff !important;}
+.bg3{background-color:#3EB271;color:#fff !important;}
+.bg4{background-color:#FEA162;color:#fff !important;}
+.bg5{background-color:#599ded;color:#fff !important;}
+.bg7{background-color:#A2ADB9 !important;color:#fff}
+.bgf5{background-color:#f5f5f5 !important;color:#666}
+.bgf2{background-color:#f2f2f2 !important}
+.flex1{flex:1;width:100%}
+
+/* 投影 */
+.shadow-dd{box-shadow:0 0 20rpx #ccc}
+.ov{overflow:hidden}
+.shadowLine{box-shadow:0px 4px 8px rgba(155,170,194,0.09);height:8px;width:100%;margin-top:-8px;position:relative;z-index:20}
+.cur:active{opacity:0.8}
+
+/* 边距 */
+.mri5{margin-right:5rpx;}
+.mri10{margin-right:10rpx;}
+.mri15{margin-right:15rpx;}
+.mri20{margin-right:20rpx;}
+.mri25{margin-right:25rpx;}
+.mri30{margin-right:30rpx;}
+.mri35{margin-right:35rpx;}
+.mri40{margin-right:40rpx;}
+.mri45{margin-right:45rpx;}
+.mri50{margin-right:50rpx;}
+.mri55{margin-right:55rpx;}
+.mri60{margin-right:60rpx;}
+.mri65{margin-right:65rpx;}
+.mri70{margin-right:70rpx;}
+.mri75{margin-right:75rpx;}
+
+.mbt5{margin-bottom:5rpx;}
+.mbt10{margin-bottom:10rpx;}
+.mbt15{margin-bottom:15rpx;}
+.mbt20{margin-bottom:20rpx;}
+.mbt25{margin-bottom:25rpx;}
+.mbt30{margin-bottom:30rpx;}
+.mbt35{margin-bottom:35rpx;}
+.mbt40{margin-bottom:40rpx;}
+.mbt45{margin-bottom:45rpx;}
+.mbt50{margin-bottom:50rpx;}
+.mbt55{margin-bottom:55rpx;}
+.mbt60{margin-bottom:60rpx;}
+.mbt65{margin-bottom:65rpx;}
+.mbt70{margin-bottom:70rpx;}
+.mbt75{margin-bottom:75rpx;}
+
+.mat5{margin-top:5rpx;}
+.mat10{margin-top:10rpx;}
+.mat15{margin-top:15rpx;}
+.mat20{margin-top:20rpx;}
+.mat25{margin-top:25rpx;}
+.mat30{margin-top:30rpx;}
+.mat35{margin-top:35rpx;}
+.mat40{margin-top:40rpx;}
+.mat45{margin-top:45rpx;}
+.mat50{margin-top:50rpx;}
+.mat55{margin-top:55rpx;}
+.mat60{margin-top:60rpx;}
+.mat65{margin-top:65rpx;}
+.mat70{margin-top:70rpx;}
+.mat75{margin-top:75rpx;}
+
+.mle5{margin-left:5rpx;}
+.mle10{margin-left:10rpx;}
+.mle15{margin-left:15rpx;}
+.mle20{margin-left:20rpx;}
+.mle25{margin-left:25rpx;}
+.mle30{margin-left:30rpx;}
+.mle35{margin-left:35rpx;}
+.mle40{margin-left:40rpx;}
+.mle45{margin-left:45rpx;}
+.mle50{margin-left:50rpx;}
+.mle55{margin-left:55rpx;}
+.mle60{margin-left:60rpx;}
+.mle65{margin-left:65rpx;}
+.mle70{margin-left:70rpx;}
+.mle75{margin-left:75rpx;}
+
+
+/* /边框/ */
+.bt15{border-bottom:15rpx solid #f2f2f2}
+.bt1{border-bottom:1px solid #f2f2f2}
+
+#footer{position:fixed;width:100%;background-color:#222326;bottom:0;left:0;text-align:center;z-index:999;color:#777;display:none !important}
+#footer .dd{padding:20rpx 70rpx}
+#footer .dd view{line-height:30rpx}
+#footer .iconfont{font-size:40rpx;}
+#footer image{display:block;margin:0 auto 6rpx;width:50rpx;height:50rpx;}
+
+.footpaddBt{height:164rpx}
+.haveFt{height:96rpx;width:100%}
+.haveFt.haveH{height:164rpx;}
+.bd-dd .dd:last-child,.bd-dd .li:last-child{border-bottom:none;}
+.bd-no{border:none !important}
+
+/* 弹窗 */
+.pup{position:fixed;width:100%;height:100%;left:0;top:0;z-index:999}
+.pup-box{position:absolute;width:100%;height:auto;max-height:70%;overflow-y:auto;padding:35rpx 20rpx;left:0;bottom:0;z-index:50}
+.pup-bg{position:absolute;width:100%;height:100%;z-index:40;background-color:#000000;left:0;bottom:0;opacity:0.3}
+
+
+.m100{min-height:100%}
+.padd30{padding:30rpx 0;}
+.h2{line-height:50rpx;}
+.LH18{line-height:1.8}
+.LH16{line-height:1.6}
+.LH2{line-height:2}
+.H70{height:70rpx;}
+.H80{height:80rpx;}
+.H90{height:90rpx;}
+.H100{height:100rpx;}
+.no{display:none}
+.ico-ri{width:12rpx;height:23rpx;}
+.ico-down{width:14rpx;height:9rpx;}
+.flex1{width:100%;flex:1}
+.z1{position:relative;z-index:1}
+.z10{position:relative;z-index:10}
+.z20{position:relative;z-index:20}
+.z30{position:relative;z-index:30}
+.z40{position:relative;z-index:40}
+.z50{position:relative;z-index:50}
+.z60{position:relative;z-index:60}
+.bgct{background-repeat:no-repeat;background-position: center}
+
+
+
+
+
+
+
+#AuthMap .box{position:relative;z-index:9999;padding:60rpx 100rpx}
+#AuthMap .btn-box .btn{width:48%;height:70rpx;border-radius:10rpx}
+#AuthMap .btn-box .btn1{background-color:rgba(0,0,0,0.1);color:#333;}
+#AuthMap .p1{margin:20rpx 0 50rpx}
+
+
+/* 本项目公用css */
+/* page{padding-top:210rpx} */
+#nav_top{font-size:36rpx;z-index:99999;text-align:center;line-height:60rpx;position:fixed;top:0;width:100%;padding:50rpx 0 10rpx}
+.trans{transition: all ease-in .3s}
+.topLine{position:fixed;width:100%;height:10rpx;box-shadow:0 0 10rpx #ededed;left:0;top:-10rpx;z-index:999;background-color:#fff}
+
+
+
+.bottom{width:620rpx;}
+.bottom .submit{width:100%;height:90rpx;color:#fff;border:1px solid #fff;font-size:36rpx;margin:80rpx 0 20rpx;border-radius:50rpx;}
+.bottom .copy{padding:20rpx 0;}
+
+.ri-ico{padding-right:50rpx;background-position:right center;background-repeat:no-repeat;background-size:12rpx;}
+.bookSubmit{background-color: #383A3D;color: #fff;height:85rpx;border-radius:25rpx;-webkit-border-radius:25rpx;font-size:32rpx}
+#submitBox{position:fixed;left:0;width:100%;bottom:0;z-index:9999;background-color:#fff;box-shadow:0 0 10rpx #ddd}
+.wxParse-p image{max-width:100%;width:100% !important;display:block}
+
+.tipBox{padding:100rpx;text-align:center;font-size:35rpx;}
+
+/* 答题游戏 */
+.findList-bg2::after{background-image:url(https://ft-xcx.maoln.com/uploads/image/2-bg2.png);background-position:center bottom;width:85rpx;height:20rpx;content:'';position:absolute;left:50%;top:100%;transform:translateX(-50%);display:block}
+.game-list .imgW::after{background-image:url(https://ft-xcx.maoln.com/uploads/image/2-bg3.png);background-size:30rpx}
+.answer-top .num{background-image:url(https://ft-xcx.maoln.com/uploads/image/202-bg2.png);background-size:100%}
+.answer-top.on .num{background-image:url(https://ft-xcx.maoln.com/uploads/image/202-bg2on.png);background-size:100%;font-size:40rpx}
+
+#answer_ban .ban-item{background-image:url(https://ft-xcx.maoln.com/uploads/image/202-bg3.png);background-size:58rpx;background-position:96% 96%;background-repeat:no-repeat}
+#zhuc_pup .zc-pup-bg1{background-image:url(https://ft-xcx.maoln.com/uploads/image/303-zc1.png);background-size:314rpx;margin-bottom:50rpx;}
+#myCar_pup .pup-bg1{background-image:url(https://ft-xcx.maoln.com/uploads/image/mycar.png);background-size:427rpx;}
+.map-img{background-image:url(https://ft-xcx.maoln.com/uploads/image/map.png);background-size:100%;}
+#answer_ban{background-image:url(https://ft-xcx.maoln.com/uploads/image/203-01.png);background-size:100%;}
+.answer-end-box.on::after{background-image:url(https://ft-xcx.maoln.com/uploads/image/4-03.png);background-size:503rpx;background-repeat:no-repeat;background-position: center 30rpx;}
+
+
+
+.text-img{width:100%;height:350rpx;margin:50rpx auto 150rpx;display:block}
+
+
+/* 进度条 */
+.answer-top{margin:60rpx 0 20rpx;padding-left:5%;color: #fff}
+.answer-top .tx{width:90rpx;height:90rpx;}
+.answer-top .w2{margin:0 10rpx 0 15rpx;}
+.answer-top .line{height:18rpx;background-color:rgba(255, 255, 255, 0.2);width:100%;margin-top:10rpx}
+.answer-top .line-con{background:linear-gradient(90deg,rgba(247,87,24,1) 0%,rgba(252,191,59,1) 100%);height:100%;width:20%;transition: all ease .3s}
+.answer-top .num{width:145rpx;height:80rpx;padding-left:30rpx;font-size:60rpx;color:#fff}
+.answer-top.on .line-con{width:100% !important;background:linear-gradient(90deg,rgba(40,96,255,1) 0%,rgba(56,206,255,1) 100%);}
+
+#answer_ban_box{z-index:90}
+#answer_ban,#answer_ban swiper-item{overflow:visible !important;height:850rpx;}
+#answer_ban_box .ban-item{background-color:linear-gradient(90deg,#28292e 100%,#1d1c1e 100%);color: #fff;margin:50rpx 20rpx;padding:120rpx 30rpx;height:750rpx;box-shadow:0px 12px 32px rgba(0,0,0,0.36);}
+#answer_ban .h3{line-height:45rpx;height:90rpx;margin-bottom:20rpx}
+#answer_ban .li{font-size:34rpx;min-height:88rpx;margin-bottom:40rpx;background-color:#282B39}
+#answer_ban_box .copy{height:100rpx;position:absolute;bottom:50rpx;width:580rpx;left:50%;color: rgba(255,255,255,0.3);transform:translateX(-50%)}
+#answer_ban_box .copy .num{position:absolute;left:34rpx;height:100rpx;}
+#answer_ban_box .time{width:112rpx;height:112rpx;background:linear-gradient(360deg,rgba(25,24,28,1) 0%,rgba(32,37,56,1) 100%);color:#fff;position:absolute;font-size:40rpx;left:50%;top:0;transform:translateX(-50%)}
+#answer_ban_box .time::after{content:'';width:104rpx;height:104rpx;display:block;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);border:4rpx solid #389FFF;border-radius:50%}
+
+#answer_ban .li{box-shadow: 0 0 20rpx rgba(39,42,56,0.9)}
+#answer_ban .li.on1{background:linear-gradient(360deg,#2DACF5 0%,#203AFE 100%);box-shadow: 0 0 20rpx rgba(35,85,252,1)}
+#answer_ban .li.on2{background:linear-gradient(7deg,#F71858 0%,#FC3A3C 100%);box-shadow: 0 0 20rpx rgba(252,58,60,1)}
+.tit-top{height:500rpx;width:100%;display:flex;align-items:center;justify-content:center;font-size:76rpx;color:#27edff;font-weight:bold;text-shadow: 8rpx 8rpx 0px rgb(0, 0, 0);margin-bottom:40rpx}
+
+.line-h4{line-height:45rpx;font-size:32rpx;display:flex;}
+.line-h4::before{content:'';width:10rpx;height:36rpx;background-color:#366fff;display:block; border-radius:10rpx;margin-right:10rpx;margin-top:5rpx;}
+
+
+
+
+
+/* css3 动画 */
+.fadeIn,.fadeOut{
+   /** 动画延迟开始 **/
+  animation-duration:3s;-webkit-animation-duration:3s; /** 动画完成时间 **/
+  animation-iteration-count:1;-webkit-animation-iteration-count:1; /** 动画循环次数  n-次数,infinite-无限循环 **/
+  animation-timing-function:ease;-webkit-animation-timing-function:ease; /** 运动效果,linear=匀速 ease=慢快慢 ease-in=渐快 ease-out=渐慢 **/
+  animation-fill-mode:forwards;-webkit-animation-fill-mode:forwards; /** 规定当动画不播放时的状态,forwards-结束时的状态 **/
+}
+.fadeIn{animation-name: fadeIn;-webkit-animation-name: fadeIn; opacity:0;animation-delay:1s;-webkit-animation-delay:1s;}
+@keyframes fadeIn {0% {opacity: 0;} 30% {opacity: 1;} 70% {opacity: 1;} 100% {opacity: 0;}}
+@-webkit-keyframes fadeIn {0% {opacity: 0;} 30% {opacity: 1;} 70% {opacity: 1;} 100% {opacity: 0;}}
+
+.fadeOut{animation-name: fadeOut;-webkit-animation-name: fadeOut;opacity:0}
+@keyframes fadeOut {0% {opacity: 0;} 100% {opacity: 1;}}
+@-webkit-keyframes fadeOut {0% {opacity: 0;} 100% {opacity: 1;}}
+
+
+.err{
+ animation-direction:alternate;
+-webkit-animation-direction:alternate; /* Safari 和 Chrome */
+  animation-name: err;-webkit-animation-name: err;
+  animation-duration:0.1s;-webkit-animation-duration:0.1s;
+  animation-iteration-count:5;-webkit-animation-iteration-count:5;
+  animation-timing-function:ease-out;-webkit-animation-timing-function:ease-out;
+}
+@keyframes err {0% {transform:translateX(30rpx);} 100% {transform:translateX(0);}}
+@-webkit-keyframes err {0% {transform:translateX(30rpx);} 100% {transform:translateX(0);}}

+ 16 - 0
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/pages/Authorize/Authorize.js

@@ -0,0 +1,16 @@
+
+Page({
+  data: {
+    
+
+  },
+  onLoad: function (options) {
+    
+  },
+  onShow: function () {
+    var that = this;
+    
+  } ,
+
+
+});

+ 3 - 0
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/pages/Authorize/Authorize.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "授权登录"
+}

+ 13 - 0
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/pages/Authorize/Authorize.wxml

@@ -0,0 +1,13 @@
+<view class="pup flex-ct font32" id="AuthMap" wx:if='{{!user}}'>
+  <view class="box rd10 bgff tc ">
+    <view class="font35 h00">您还未登录</view>
+    <view class="h99 p1">请先登录再操作</view>
+    <view class="btn-box flex-bect">
+      <view class="btn btn1 flex-ct" bindtap="Authorize">取消</view>
+      <button class='btn btn2 flex-ct bg1' bindtap="getUserProfile">立即登录</button>
+      <!-- <button class='btn btn2 flex-ct bg1' catchtap="GetUserInfo">立即登录</button> -->
+      <!-- <button class='btn btn2 flex-ct bg1' open-type="getUserInfo" bindgetuserinfo='bindGetUserInfo'>立即登录</button> -->
+    </view>
+  </view>
+  <view class="pup-bg"></view>
+</view>

+ 8 - 0
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/pages/Authorize/Authorize.wxss

@@ -0,0 +1,8 @@
+/* 授权 */
+#login .logo{width:180rpx;height:180rpx;display:block;margin:125rpx auto 175rpx;}
+
+#login .btn_return{background-color:transparent;width:670rpx;height:88rpx;display:block;margin:200rpx auto 30rpx;line-height:75rpx}
+.login-p{position:absolute;left:0;bottom:6.3%;width:100%}
+
+
+

BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/pages/Authorize/img/ico-homeon.png


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/pages/Authorize/img/logo.png


+ 218 - 0
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/pages/index/index.js

@@ -0,0 +1,218 @@
+const _api = require('../../utils/api.js')
+const request = require('../../utils/js.js');
+const api = _api.api;
+const app = getApp()
+const globalData = app.globalData
+Page({
+  data: {
+    tel:''
+  },
+
+  /**  生命周期函数--监听页面加载 **/
+  onLoad: function (options) {
+    var that = this;
+    that.setKey(that)
+  },
+
+ /********************  微信授权  *****************************/
+  AuthMap() { app.AuthMap(this) },
+  //授权登录
+  Authorize() { app.Authorize(this) },
+  bindGetUserInfo(e){
+    var that = this
+    app.login(that,e,function(res){
+      
+    })
+  },
+   /******************** 微信授权  *****************************/
+
+
+  onPullDownRefresh(e){
+    
+  },
+
+  /** 页面上拉触底事件 **/
+  onReachBottom: function () {
+    var that = this;
+  },
+
+  /** 用户点击右上角分享 **/
+  onShareAppMessage: function () {
+    return {
+      title: globalData.share.title,
+      path: globalData.share.path,
+      imageUrl: globalData.share.imageUrl // 图片 URL
+    }
+  },
+  getUserProfile(_that, sessionKey,sucFun) {
+    var that=this
+    wx.getUserProfile({
+        desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
+      success:function(res2){
+        // console.log('获取成功: ',res2)
+          //调用登录接口
+          var code = ''
+          request.login().then(function (d) {
+            code = d.code
+            console.log(code) 
+          }).then(function (e) {
+            that.ajaxget(api.code + '?code=' + code, {}, {}, function (res) {
+
+              if (res.code == 1) {
+                // that.saveUserInfo(_that, res.data.session_key, sucFun)
+                that.ajaxpost(api.login, {}, {
+                  'encryptedData': res2.encryptedData,
+                  'iv': res2.iv,
+                  'sessionKey': res.data.session_key,
+                  'openid': res.data.openid
+                }, function (e) {
+                  console.log(e)
+                  if (e.code == 1) {
+                    console.log('成功啦')
+                    wx.setStorageSync('user', e.data)
+                    wx.setStorageSync('sessionKey', res.data.session_key)
+                    wx.setStorageSync('token', e.data.token)
+                    that.setData({ Authorize: true, user: e.data, token: e.data.token })
+                    // sucFun(e.data)
+                  }
+          
+                }, function (e) {
+          
+                }, function () { })
+              } else {
+                that.showToast(res.msg)
+                console.log('失败')
+              }
+            }, function (res) { }, function (res) { })
+          });
+        },
+        fail:function(err){
+          console.log("获取失败: ",err)
+        }
+    })
+
+  },
+  setKey(_that){
+    var that=this
+    _that.setData({
+      token: wx.getStorageSync('token')
+      , user: wx.getStorageSync('user')
+      , Authorize: false
+    })
+  },
+
+
+  //post请求-token
+  ajaxget: function (url, header, data, successFunc, errFunc) {
+    let that = this;
+    var _errFunc = function (msg) {
+      if (!!errMsg) {
+        wx.showToast({
+          title: msg || errMsg,
+          icon: 'none'
+        })
+      }
+    };
+    let _data = data || {};//数据类型
+    let token = wx.getStorageSync('token');//授权后的用户唯一码(openid)
+    let _header = {//请求头
+      'content-type': 'application/x-www-form-urlencoded',
+      'token': token,
+    };
+    wx.request({
+      url: url,
+      data: _data,
+      method: 'get',
+      header: _header,
+      success(res) {
+        if (res) {
+          res = res.data;
+          successFunc(res);
+        }
+        if (!res) {
+          _errFunc(res)
+          return;
+        }
+      },
+      fail() {
+        _errFunc(res);
+      }
+    })
+  },
+  //post请求-token
+  ajaxpost: function (url, header, data, successFunc, errFunc) {
+    let that = this;
+    var _errFunc = function (msg) {
+      if (!!errMsg) {
+        wx.showToast({
+          title: msg || errMsg,
+          icon: 'none'
+        })
+      }
+    };
+    let _data = data || {};//数据类型
+    let token = wx.getStorageSync('token');//授权后的用户唯一码(openid)
+    let _header = {//请求头
+      'content-type': 'application/x-www-form-urlencoded',
+      'token': token,
+      lat: wx.getStorageSync('location').lat,
+      lng: wx.getStorageSync('location').lng
+    };
+    wx.request({
+      url: url,
+      data: _data,
+      method: 'post',
+      header: _header,
+      success(res) {
+        if (res) {
+          res = res.data;
+          successFunc(res);
+        }
+        if (!res) {
+          _errFunc(res)
+          return;
+        }
+      },
+      fail() {
+        _errFunc(res);
+      }
+    })
+  },
+  
+  getPhoneNumber(res){
+    console.log(res)
+    let that = this
+    let _data = {
+      encryptedData:res.detail.encryptedData,
+      iv:res.detail.iv,
+      sessionKey:wx.getStorageSync('sessionKey')
+    }
+    that.ajaxpost(api.getPhone, {}, _data, function (e) {
+      console.log(e)
+      if (e.code == 1) {
+        console.log('成功啦')
+        that.setData({
+          tel:e.data.phoneNumber
+        })
+      }
+
+    })
+    
+  },
+
+
+   /**  生命周期函数--监听页面初次渲染完成 **/
+  onReady: function () {
+
+  },
+
+  /** 生命周期函数--监听页面隐藏 **/
+  onHide: function () {
+
+  },
+
+  /** 生命周期函数--监听页面卸载 **/
+  onUnload: function () {
+
+  }
+})

+ 5 - 0
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/pages/index/index.json

@@ -0,0 +1,5 @@
+{
+  "navigationBarTitleText": "福田戴姆勒",
+  "backgroundColor":"#252A2D",
+  "enablePullDownRefresh":true
+}

+ 23 - 0
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/pages/index/index.wxml

@@ -0,0 +1,23 @@
+<block><include src="../../pages/Authorize/Authorize.wxml" /></block>
+<image src="{{user.avatar}}" class="ico100 rd50" style="margin:180rpx auto 30rpx;display:block"></image>
+<view class="tc redff font40">{{user.nickname}}</view>
+
+
+
+
+<view class="pup flex-ct font32" id="AuthMap" wx:if='{{user}}'>
+  <view class="box rd10 bgff tc ">
+    <view wx:if="{{tel}}"   class="phoneColor" >{{tel}}</view>
+    <button class='btn btn2 flex-ct bg1' wx:if="{{!tel}}" style="border-radius:40rpx" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">获取手机号</button>
+    <!-- <view class="h99 p1">请先登录再操作</view> -->
+    <view class="btn-box flex-bect">
+      <!-- <view class="btn btn1 flex-ct" bindtap="Authorize">取消</view>
+      <button class='btn btn2 flex-ct bg1' bindtap="getUserProfile">立即登录</button> -->
+
+      <!-- <button class='btn btn2 flex-ct bg1' open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">获取手机号</button> -->
+      <!-- <button class='btn btn2 flex-ct bg1' catchtap="GetUserInfo">立即登录</button> -->
+      <!-- <button class='btn btn2 flex-ct bg1' open-type="getUserInfo" bindgetuserinfo='bindGetUserInfo'>立即登录</button> -->
+    </view>
+  </view>
+  <view class="pup-bg"></view>
+</view>

+ 28 - 0
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/pages/index/index.wxss

@@ -0,0 +1,28 @@
+.top{background:radial-gradient(circle,rgba(55,57,64,1) 0%,rgba(14,14,19,1) 100%);height:750rpx;}
+.top image{width:100%;display:block;}
+/* .top::after{content:'';width:100%;height:100%;position:absolute;left:0;top:0;z-index:9;display:block;box-shadow:0 0 300rpx #27292B inset} */
+
+.top-nav{position: absolute;width:100%;left:0;bottom:70rpx;z-index:20;}
+.top-nav .dd{width:23%;margin-right:2.6%;background:rgba(255,255,255,0.3);border:1px solid #ACACAC;border-radius:40rpx;-webkit-border-radius:40rpx;float:left;text-align: center;line-height:55rpx;color: #fff;margin-bottom:15rpx}
+.top-nav .dd:nth-child(4n+4){margin-right:0;}
+.top-nav .dd.on{background-color: #fff;color:#333}
+
+page{background-color: #252A2D;}
+.con-list{color: #C7C7C7;font-size:28rpx;}
+.con-list .dd{border-bottom:1px solid #383A3D;}
+.con-list .ri-ico{height:110rpx;}
+
+ .bottom .submit{margin-top:105rpx;}
+ 
+
+
+ /* 授权 */
+#login .logo{width:180rpx;height:180rpx;display:block;margin:125rpx auto 175rpx;}
+
+#login .btn_return{background-color:transparent;width:670rpx;height:88rpx;display:block;margin:200rpx auto 30rpx;line-height:75rpx}
+.login-p{position:absolute;left:0;bottom:6.3%;width:100%}
+
+.phoneColor{color: rgb(8, 8, 8);font-weight: 600;}
+
+
+

+ 69 - 0
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/project.config.json

@@ -0,0 +1,69 @@
+{
+  "description": "项目配置文件。",
+  "packOptions": {
+    "ignore": []
+  },
+  "setting": {
+    "urlCheck": true,
+    "es6": true,
+    "enhance": false,
+    "postcss": true,
+    "preloadBackgroundData": false,
+    "minified": true,
+    "newFeature": true,
+    "coverView": true,
+    "nodeModules": false,
+    "autoAudits": false,
+    "showShadowRootInWxmlPanel": true,
+    "scopeDataCheck": false,
+    "uglifyFileName": false,
+    "checkInvalidKey": true,
+    "checkSiteMap": true,
+    "uploadWithSourceMap": true,
+    "compileHotReLoad": false,
+    "useMultiFrameRuntime": true,
+    "useApiHook": true,
+    "useApiHostProcess": true,
+    "babelSetting": {
+      "ignore": [],
+      "disablePlugins": [],
+      "outputPath": ""
+    },
+    "enableEngineNative": false,
+    "useIsolateContext": true,
+    "useCompilerModule": true,
+    "userConfirmedUseCompilerModuleSwitch": false,
+    "userConfirmedBundleSwitch": false,
+    "packNpmManually": false,
+    "packNpmRelationList": [],
+    "minifyWXSS": true
+  },
+  "compileType": "miniprogram",
+  "libVersion": "2.16.1",
+  "appid": "wx436f3c5d196b94e7",
+  "projectname": "%E6%8E%88%E6%9D%83%E7%99%BB%E5%BD%95",
+  "isGameTourist": false,
+  "simulatorType": "wechat",
+  "simulatorPluginLibVersion": {},
+  "condition": {
+    "search": {
+      "list": []
+    },
+    "conversation": {
+      "list": []
+    },
+    "plugin": {
+      "list": []
+    },
+    "game": {
+      "currentL": -1,
+      "list": []
+    },
+    "gamePlugin": {
+      "list": []
+    },
+    "miniprogram": {
+      "list": []
+    }
+  }
+}

+ 7 - 0
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/sitemap.json

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

+ 260 - 0
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/utils/Promise.js

@@ -0,0 +1,260 @@
+var t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
+    return typeof t;
+} : function(t) {
+    return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
+};
+
+!function(e, n) {
+    "object" == ("undefined" == typeof exports ? "undefined" : t(exports)) && "undefined" != typeof module ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : e.ES6Promise = n();
+}(void 0, function() {
+    function e(e) {
+        var n = void 0 === e ? "undefined" : t(e);
+        return null !== e && ("object" === n || "function" === n);
+    }
+    function n(t) {
+        return "function" == typeof t;
+    }
+    function r() {
+        return void 0 !== D ? function() {
+            D(i);
+        } : o();
+    }
+    function o() {
+        var t = setTimeout;
+        return function() {
+            return t(i, 1);
+        };
+    }
+    function i() {
+        for (var t = 0; t < F; t += 2) (0, G[t])(G[t + 1]), G[t] = void 0, G[t + 1] = void 0;
+        F = 0;
+    }
+    function s(t, e) {
+        var n = arguments, r = this, o = new this.constructor(c);
+        void 0 === o[I] && x(o);
+        var i = r._state;
+        return i ? function() {
+            var t = n[i - 1];
+            L(function() {
+                return j(i, o, t, r._result);
+            });
+        }() : w(r, o, t, e), o;
+    }
+    function u(e) {
+        var n = this;
+        if (e && "object" == (void 0 === e ? "undefined" : t(e)) && e.constructor === n) return e;
+        var r = new n(c);
+        return _(r, e), r;
+    }
+    function c() {}
+    function f() {
+        return new TypeError("You cannot resolve a promise with itself");
+    }
+    function a() {
+        return new TypeError("A promises callback cannot return that same promise.");
+    }
+    function l(t) {
+        try {
+            return t.then;
+        } catch (t) {
+            return V.error = t, V;
+        }
+    }
+    function h(t, e, n, r) {
+        try {
+            t.call(e, n, r);
+        } catch (t) {
+            return t;
+        }
+    }
+    function d(t, e, n) {
+        L(function(t) {
+            var r = !1, o = h(n, e, function(n) {
+                r || (r = !0, e !== n ? _(t, n) : m(t, n));
+            }, function(e) {
+                r || (r = !0, b(t, e));
+            }, "Settle: " + (t._label || " unknown promise"));
+            !r && o && (r = !0, b(t, o));
+        }, t);
+    }
+    function p(t, e) {
+        e._state === Q ? m(t, e._result) : e._state === R ? b(t, e._result) : w(e, void 0, function(e) {
+            return _(t, e);
+        }, function(e) {
+            return b(t, e);
+        });
+    }
+    function v(t, e, r) {
+        e.constructor === t.constructor && r === s && e.constructor.resolve === u ? p(t, e) : r === V ? (b(t, V.error), 
+        V.error = null) : void 0 === r ? m(t, e) : n(r) ? d(t, e, r) : m(t, e);
+    }
+    function _(t, n) {
+        t === n ? b(t, f()) : e(n) ? v(t, n, l(n)) : m(t, n);
+    }
+    function y(t) {
+        t._onerror && t._onerror(t._result), g(t);
+    }
+    function m(t, e) {
+        t._state === J && (t._result = e, t._state = Q, 0 !== t._subscribers.length && L(g, t));
+    }
+    function b(t, e) {
+        t._state === J && (t._state = R, t._result = e, L(y, t));
+    }
+    function w(t, e, n, r) {
+        var o = t._subscribers, i = o.length;
+        t._onerror = null, o[i] = e, o[i + Q] = n, o[i + R] = r, 0 === i && t._state && L(g, t);
+    }
+    function g(t) {
+        var e = t._subscribers, n = t._state;
+        if (0 !== e.length) {
+            for (var r = void 0, o = void 0, i = t._result, s = 0; s < e.length; s += 3) r = e[s], 
+            o = e[s + n], r ? j(n, r, o, i) : o(i);
+            t._subscribers.length = 0;
+        }
+    }
+    function A() {
+        this.error = null;
+    }
+    function S(t, e) {
+        try {
+            return t(e);
+        } catch (t) {
+            return X.error = t, X;
+        }
+    }
+    function j(t, e, r, o) {
+        var i = n(r), s = void 0, u = void 0, c = void 0, f = void 0;
+        if (i) {
+            if ((s = S(r, o)) === X ? (f = !0, u = s.error, s.error = null) : c = !0, e === s) return void b(e, a());
+        } else s = o, c = !0;
+        e._state !== J || (i && c ? _(e, s) : f ? b(e, u) : t === Q ? m(e, s) : t === R && b(e, s));
+    }
+    function E(t, e) {
+        try {
+            e(function(e) {
+                _(t, e);
+            }, function(e) {
+                b(t, e);
+            });
+        } catch (e) {
+            b(t, e);
+        }
+    }
+    function T() {
+        return Z++;
+    }
+    function x(t) {
+        t[I] = Z++, t._state = void 0, t._result = void 0, t._subscribers = [];
+    }
+    function M(t, e) {
+        this._instanceConstructor = t, this.promise = new t(c), this.promise[I] || x(this.promise), 
+        q(e) ? (this.length = e.length, this._remaining = e.length, this._result = new Array(this.length), 
+        0 === this.length ? m(this.promise, this._result) : (this.length = this.length || 0, 
+        this._enumerate(e), 0 === this._remaining && m(this.promise, this._result))) : b(this.promise, P());
+    }
+    function P() {
+        return new Error("Array Methods must be provided an Array");
+    }
+    function C() {
+        throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");
+    }
+    function O() {
+        throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
+    }
+    function k(t) {
+        this[I] = T(), this._result = this._state = void 0, this._subscribers = [], c !== t && ("function" != typeof t && C(), 
+        this instanceof k ? E(this, t) : O());
+    }
+    var Y = void 0, q = Y = Array.isArray ? Array.isArray : function(t) {
+        return "[object Array]" === Object.prototype.toString.call(t);
+    }, F = 0, D = void 0, K = void 0, L = function(t, e) {
+        G[F] = t, G[F + 1] = e, 2 === (F += 2) && (K ? K(i) : H());
+    }, N = "undefined" != typeof window ? window : void 0, U = N || {}, W = U.MutationObserver || U.WebKitMutationObserver, z = "undefined" == typeof self && "undefined" != typeof process && "[object process]" === {}.toString.call(process), B = "undefined" != typeof Uint8ClampedArray && "undefined" != typeof importScripts && "undefined" != typeof MessageChannel, G = new Array(1e3), H = void 0;
+    H = z ? function() {
+        return process.nextTick(i);
+    } : W ? function() {
+        var t = 0, e = new W(i), n = document.createTextNode("");
+        return e.observe(n, {
+            characterData: !0
+        }), function() {
+            n.data = t = ++t % 2;
+        };
+    }() : B ? function() {
+        var t = new MessageChannel();
+        return t.port1.onmessage = i, function() {
+            return t.port2.postMessage(0);
+        };
+    }() : void 0 === N && "function" == typeof require ? function() {
+        try {
+            var t = require("vertx");
+            return D = t.runOnLoop || t.runOnContext, r();
+        } catch (t) {
+            return o();
+        }
+    }() : o();
+    var I = Math.random().toString(36).substring(16), J = void 0, Q = 1, R = 2, V = new A(), X = new A(), Z = 0;
+    return M.prototype._enumerate = function(t) {
+        for (var e = 0; this._state === J && e < t.length; e++) this._eachEntry(t[e], e);
+    }, M.prototype._eachEntry = function(t, e) {
+        var n = this._instanceConstructor, r = n.resolve;
+        if (r === u) {
+            var o = l(t);
+            if (o === s && t._state !== J) this._settledAt(t._state, e, t._result); else if ("function" != typeof o) this._remaining--, 
+            this._result[e] = t; else if (n === k) {
+                var i = new n(c);
+                v(i, t, o), this._willSettleAt(i, e);
+            } else this._willSettleAt(new n(function(e) {
+                return e(t);
+            }), e);
+        } else this._willSettleAt(r(t), e);
+    }, M.prototype._settledAt = function(t, e, n) {
+        var r = this.promise;
+        r._state === J && (this._remaining--, t === R ? b(r, n) : this._result[e] = n), 
+        0 === this._remaining && m(r, this._result);
+    }, M.prototype._willSettleAt = function(t, e) {
+        var n = this;
+        w(t, void 0, function(t) {
+            return n._settledAt(Q, e, t);
+        }, function(t) {
+            return n._settledAt(R, e, t);
+        });
+    }, k.all = function(t) {
+        return new M(this, t).promise;
+    }, k.race = function(t) {
+        var e = this;
+        return new e(q(t) ? function(n, r) {
+            for (var o = t.length, i = 0; i < o; i++) e.resolve(t[i]).then(n, r);
+        } : function(t, e) {
+            return e(new TypeError("You must pass an array to race."));
+        });
+    }, k.resolve = u, k.reject = function(t) {
+        var e = new this(c);
+        return b(e, t), e;
+    }, k._setScheduler = function(t) {
+        K = t;
+    }, k._setAsap = function(t) {
+        L = t;
+    }, k._asap = L, k.prototype = {
+        constructor: k,
+        then: s,
+        catch: function(t) {
+            return this.then(null, t);
+        }
+    }, k.polyfill = function() {
+        var t = void 0;
+        if ("undefined" != typeof global) t = global; else if ("undefined" != typeof self) t = self; else try {
+            t = Function("return this")();
+        } catch (t) {
+            throw new Error("polyfill failed because global object is unavailable in this environment");
+        }
+        var e = t.Promise;
+        if (e) {
+            var n = null;
+            try {
+                n = Object.prototype.toString.call(e.resolve());
+            } catch (t) {}
+            if ("[object Promise]" === n && !e.cast) return;
+        }
+        t.Promise = k;
+    }, k.Promise = k, k;
+});

+ 67 - 0
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/utils/api.js

@@ -0,0 +1,67 @@
+var http = 'https://duzhe.maoln.com/api/';
+var index = http + 'index/'  //首页
+var map = http + 'map/'
+var subscribe = http + 'subscribe/'
+var user = http + 'user/'
+var activity = http + 'activity/'
+
+var api = {
+  http: http
+  , code: http + 'auth_login_with_wechat/code' //获取openid跟session_key接口
+  , login: http + 'auth_login_with_wechat/login'//确认授权登录接口
+  , getPhone: http + 'auth_login_with_wechat/getPhone'//获取手机号接口
+  , sendMsg: http + 'sms/sendMsg'// 发送验证码接口
+  , get_city: http + 'subscribe/get_city' //获取城市
+  // 首页
+  , index: index + 'index'// 获取首页信息
+  , content: index + 'content'// 底部提示信息
+  , indexDetail: index + 'detail'// 获取首页详情
+
+  , map: map + 'map'// 地图
+  , mapIndex: map + 'index'// 地图列表
+  , mapDetail: map + 'detail'// 地图列表详情
+
+  , car_list: subscribe + 'car_list'// 获取预约选车列表
+  , subscribe: subscribe + 'subscribe'// 用户预约
+
+  , user_info: user + 'user_info'// 获取用户信息
+  , my_subscribe: user + 'my_subscribe'// 我的预约
+  , lottery: user + 'lottery'// 我的礼品卡
+
+
+  , distributor: map + 'distributor'// 经销商端
+  , distributor_list: map + 'distributor_list'// 经销商端数据
+  , scan_code: map + 'scan_code'// 扫码获取详情
+  , confirm: map + 'confirm'// 确认核销
+
+  // 活动
+  
+  , activeIndex: activity + 'index1'// 获取活动列表
+  , activeDetail: activity + 'detail'// 活动详情
+  , activeSubject: activity + 'subject'// 获取模块的题目
+  , activation: activity + 'activation'// 用户答对当前模块的所有题目
+  , answer: activity + 'answer'// 判断用户是否已完成所有问题
+  , register: activity + 'register'// 用户注册
+  , is_register: activity + 'is_register'// 判断用户是否注册
+  , receive: activity + 'receive'// 领取奖品
+  , is_gift: activity + 'is_gift'// 是否领取
+  , receive_prize: activity + 'receive_prize'// 用户领奖
+  , accept: user + 'accept'// 收下奖品
+  , know: user + 'know'// 
+
+
+
+}
+//正则
+var reg = {
+  phone: /^[1][3,4,5,6,7,8][0-9]{9}$/,//电话
+  email: /^[A-Za-z\d]+([-_.][A-Za-z\d]+)*@([A-Za-z\d]+[-.])+[A-Za-z\d]{2,4}$/,//邮箱
+  zph: /^0\d{2,3}-\d{7,8}$/,//座机
+  money : /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,//金额
+  card: /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}[0-9Xx]$)/,  //身份证号
+}
+
+module.exports = {
+  api: api,
+  reg: reg,
+}

+ 55 - 0
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/utils/countDown.js

@@ -0,0 +1,55 @@
+//小于10的格式化函数
+function timeFormat(param) {//小于10的格式化函数
+  return param < 10 ? '0' + param : param;
+}
+//日期改为时间戳(时分秒)
+function dateNum(date) {
+  date = date.substring(0, 19);
+  date = date.replace(/-/g, '/');
+  var timestamp = new Date(date).getTime();
+  return timestamp
+}
+//倒计时函数
+function countDown(_that, endTimeList) {
+  // 获取当前时间,同时得到活动结束时间数组
+  let newTime = new Date().getTime();
+  let countDownArr = [];
+  var len = endTimeList.length
+  // 对结束时间进行处理渲染到页面
+  for (let i = 0; i < len;i++){
+    let endTime = dateNum(endTimeList[i])
+    let obj = null;
+    // 如果活动未结束,对时间进行处理
+    if (endTime - newTime > 0) {
+      let time = (endTime - newTime) / 1000;
+      // 获取天、时、分、秒
+      let day = parseInt(time / (60 * 60 * 24));
+      let hou = parseInt(time % (60 * 60 * 24) / 3600);
+      let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
+      let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
+      obj = {
+        day: timeFormat(day),
+        hou: timeFormat(hou),
+        min: timeFormat(min),
+        sec: timeFormat(sec),
+        status:true
+      }
+    } else {//活动已结束,全部设置为'00'
+      obj = {
+        day: '00',
+        hou: '00',
+        min: '00',
+        sec: '00',
+        status: false
+      }
+    }
+    countDownArr.push(obj);
+  }
+  // 渲染,然后每隔一秒执行一次倒计时函数
+  _that.setData({ countDownList: countDownArr })
+}
+
+
+module.exports = {
+  countDown: countDown //倒计时函数
+}

+ 1131 - 0
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/utils/es6-promise.auto.js

@@ -0,0 +1,1131 @@
+/*!
+ * @overview es6-promise - a tiny implementation of Promises/A+.
+ * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
+ * @license   Licensed under MIT license
+ *            See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
+ * @version   v4.2.4+314e4831
+ */
+
+(function (global, factory) {
+  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+    typeof define === 'function' && define.amd ? define(factory) :
+      (global.ES6Promise = factory());
+}(this, (function () {
+  'use strict';
+
+  function objectOrFunction(x) {
+    var type = typeof x;
+    return x !== null && (type === 'object' || type === 'function');
+  }
+
+  function isFunction(x) {
+    return typeof x === 'function';
+  }
+
+
+
+  var _isArray = void 0;
+  if (Array.isArray) {
+    _isArray = Array.isArray;
+  } else {
+    _isArray = function (x) {
+      return Object.prototype.toString.call(x) === '[object Array]';
+    };
+  }
+
+  var isArray = _isArray;
+
+  var len = 0;
+  var vertxNext = void 0;
+  var customSchedulerFn = void 0;
+
+  var asap = function asap(callback, arg) {
+    queue[len] = callback;
+    queue[len + 1] = arg;
+    len += 2;
+    if (len === 2) {
+      // If len is 2, that means that we need to schedule an async flush.
+      // If additional callbacks are queued before the queue is flushed, they
+      // will be processed by this flush that we are scheduling.
+      if (customSchedulerFn) {
+        customSchedulerFn(flush);
+      } else {
+        scheduleFlush();
+      }
+    }
+  };
+
+  function setScheduler(scheduleFn) {
+    customSchedulerFn = scheduleFn;
+  }
+
+  function setAsap(asapFn) {
+    asap = asapFn;
+  }
+
+  var browserWindow = typeof window !== 'undefined' ? window : undefined;
+  var browserGlobal = browserWindow || {};
+  var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
+  var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
+
+  // test for web worker but not in IE10
+  var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';
+
+  // node
+  function useNextTick() {
+    // node version 0.10.x displays a deprecation warning when nextTick is used recursively
+    // see https://github.com/cujojs/when/issues/410 for details
+    return function () {
+      return process.nextTick(flush);
+    };
+  }
+
+  // vertx
+  function useVertxTimer() {
+    if (typeof vertxNext !== 'undefined') {
+      return function () {
+        vertxNext(flush);
+      };
+    }
+
+    return useSetTimeout();
+  }
+
+  function useMutationObserver() {
+    var iterations = 0;
+    var observer = new BrowserMutationObserver(flush);
+    var node = document.createTextNode('');
+    observer.observe(node, { characterData: true });
+
+    return function () {
+      node.data = iterations = ++iterations % 2;
+    };
+  }
+
+  // web worker
+  function useMessageChannel() {
+    var channel = new MessageChannel();
+    channel.port1.onmessage = flush;
+    return function () {
+      return channel.port2.postMessage(0);
+    };
+  }
+
+  function useSetTimeout() {
+    // Store setTimeout reference so es6-promise will be unaffected by
+    // other code modifying setTimeout (like sinon.useFakeTimers())
+    var globalSetTimeout = setTimeout;
+    return function () {
+      return globalSetTimeout(flush, 1);
+    };
+  }
+
+  var queue = new Array(1000);
+  function flush() {
+    for (var i = 0; i < len; i += 2) {
+      var callback = queue[i];
+      var arg = queue[i + 1];
+
+      callback(arg);
+
+      queue[i] = undefined;
+      queue[i + 1] = undefined;
+    }
+
+    len = 0;
+  }
+
+  function attemptVertx() {
+    try {
+      var vertx = Function('return this')().require('vertx');
+      vertxNext = vertx.runOnLoop || vertx.runOnContext;
+      return useVertxTimer();
+    } catch (e) {
+      return useSetTimeout();
+    }
+  }
+
+  var scheduleFlush = void 0;
+  // Decide what async method to use to triggering processing of queued callbacks:
+  if (isNode) {
+    scheduleFlush = useNextTick();
+  } else if (BrowserMutationObserver) {
+    scheduleFlush = useMutationObserver();
+  } else if (isWorker) {
+    scheduleFlush = useMessageChannel();
+  } else if (browserWindow === undefined && typeof require === 'function') {
+    scheduleFlush = attemptVertx();
+  } else {
+    scheduleFlush = useSetTimeout();
+  }
+
+  function then(onFulfillment, onRejection) {
+    var parent = this;
+
+    var child = new this.constructor(noop);
+
+    if (child[PROMISE_ID] === undefined) {
+      makePromise(child);
+    }
+
+    var _state = parent._state;
+
+
+    if (_state) {
+      var callback = arguments[_state - 1];
+      asap(function () {
+        return invokeCallback(_state, child, callback, parent._result);
+      });
+    } else {
+      subscribe(parent, child, onFulfillment, onRejection);
+    }
+
+    return child;
+  }
+
+  /**
+    `Promise.resolve` returns a promise that will become resolved with the
+    passed `value`. It is shorthand for the following:
+    ```javascript
+    let promise = new Promise(function(resolve, reject){
+      resolve(1);
+    });
+    promise.then(function(value){
+      // value === 1
+    });
+    ```
+    Instead of writing the above, your code now simply becomes the following:
+    ```javascript
+    let promise = Promise.resolve(1);
+    promise.then(function(value){
+      // value === 1
+    });
+    ```
+    @method resolve
+    @static
+    @param {Any} value value that the returned promise will be resolved with
+    Useful for tooling.
+    @return {Promise} a promise that will become fulfilled with the given
+    `value`
+  */
+  function resolve$1(object) {
+    /*jshint validthis:true */
+    var Constructor = this;
+
+    if (object && typeof object === 'object' && object.constructor === Constructor) {
+      return object;
+    }
+
+    var promise = new Constructor(noop);
+    resolve(promise, object);
+    return promise;
+  }
+
+  var PROMISE_ID = Math.random().toString(36).substring(2);
+
+  function noop() { }
+
+  var PENDING = void 0;
+  var FULFILLED = 1;
+  var REJECTED = 2;
+
+  var TRY_CATCH_ERROR = { error: null };
+
+  function selfFulfillment() {
+    return new TypeError("You cannot resolve a promise with itself");
+  }
+
+  function cannotReturnOwn() {
+    return new TypeError('A promises callback cannot return that same promise.');
+  }
+
+  function getThen(promise) {
+    try {
+      return promise.then;
+    } catch (error) {
+      TRY_CATCH_ERROR.error = error;
+      return TRY_CATCH_ERROR;
+    }
+  }
+
+  function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {
+    try {
+      then$$1.call(value, fulfillmentHandler, rejectionHandler);
+    } catch (e) {
+      return e;
+    }
+  }
+
+  function handleForeignThenable(promise, thenable, then$$1) {
+    asap(function (promise) {
+      var sealed = false;
+      var error = tryThen(then$$1, thenable, function (value) {
+        if (sealed) {
+          return;
+        }
+        sealed = true;
+        if (thenable !== value) {
+          resolve(promise, value);
+        } else {
+          fulfill(promise, value);
+        }
+      }, function (reason) {
+        if (sealed) {
+          return;
+        }
+        sealed = true;
+
+        reject(promise, reason);
+      }, 'Settle: ' + (promise._label || ' unknown promise'));
+
+      if (!sealed && error) {
+        sealed = true;
+        reject(promise, error);
+      }
+    }, promise);
+  }
+
+  function handleOwnThenable(promise, thenable) {
+    if (thenable._state === FULFILLED) {
+      fulfill(promise, thenable._result);
+    } else if (thenable._state === REJECTED) {
+      reject(promise, thenable._result);
+    } else {
+      subscribe(thenable, undefined, function (value) {
+        return resolve(promise, value);
+      }, function (reason) {
+        return reject(promise, reason);
+      });
+    }
+  }
+
+  function handleMaybeThenable(promise, maybeThenable, then$$1) {
+    if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {
+      handleOwnThenable(promise, maybeThenable);
+    } else {
+      if (then$$1 === TRY_CATCH_ERROR) {
+        reject(promise, TRY_CATCH_ERROR.error);
+        TRY_CATCH_ERROR.error = null;
+      } else if (then$$1 === undefined) {
+        fulfill(promise, maybeThenable);
+      } else if (isFunction(then$$1)) {
+        handleForeignThenable(promise, maybeThenable, then$$1);
+      } else {
+        fulfill(promise, maybeThenable);
+      }
+    }
+  }
+
+  function resolve(promise, value) {
+    if (promise === value) {
+      reject(promise, selfFulfillment());
+    } else if (objectOrFunction(value)) {
+      handleMaybeThenable(promise, value, getThen(value));
+    } else {
+      fulfill(promise, value);
+    }
+  }
+
+  function publishRejection(promise) {
+    if (promise._onerror) {
+      promise._onerror(promise._result);
+    }
+
+    publish(promise);
+  }
+
+  function fulfill(promise, value) {
+    if (promise._state !== PENDING) {
+      return;
+    }
+
+    promise._result = value;
+    promise._state = FULFILLED;
+
+    if (promise._subscribers.length !== 0) {
+      asap(publish, promise);
+    }
+  }
+
+  function reject(promise, reason) {
+    if (promise._state !== PENDING) {
+      return;
+    }
+    promise._state = REJECTED;
+    promise._result = reason;
+
+    asap(publishRejection, promise);
+  }
+
+  function subscribe(parent, child, onFulfillment, onRejection) {
+    var _subscribers = parent._subscribers;
+    var length = _subscribers.length;
+
+
+    parent._onerror = null;
+
+    _subscribers[length] = child;
+    _subscribers[length + FULFILLED] = onFulfillment;
+    _subscribers[length + REJECTED] = onRejection;
+
+    if (length === 0 && parent._state) {
+      asap(publish, parent);
+    }
+  }
+
+  function publish(promise) {
+    var subscribers = promise._subscribers;
+    var settled = promise._state;
+
+    if (subscribers.length === 0) {
+      return;
+    }
+
+    var child = void 0,
+      callback = void 0,
+      detail = promise._result;
+
+    for (var i = 0; i < subscribers.length; i += 3) {
+      child = subscribers[i];
+      callback = subscribers[i + settled];
+
+      if (child) {
+        invokeCallback(settled, child, callback, detail);
+      } else {
+        callback(detail);
+      }
+    }
+
+    promise._subscribers.length = 0;
+  }
+
+  function tryCatch(callback, detail) {
+    try {
+      return callback(detail);
+    } catch (e) {
+      TRY_CATCH_ERROR.error = e;
+      return TRY_CATCH_ERROR;
+    }
+  }
+
+  function invokeCallback(settled, promise, callback, detail) {
+    var hasCallback = isFunction(callback),
+      value = void 0,
+      error = void 0,
+      succeeded = void 0,
+      failed = void 0;
+
+    if (hasCallback) {
+      value = tryCatch(callback, detail);
+
+      if (value === TRY_CATCH_ERROR) {
+        failed = true;
+        error = value.error;
+        value.error = null;
+      } else {
+        succeeded = true;
+      }
+
+      if (promise === value) {
+        reject(promise, cannotReturnOwn());
+        return;
+      }
+    } else {
+      value = detail;
+      succeeded = true;
+    }
+
+    if (promise._state !== PENDING) {
+      // noop
+    } else if (hasCallback && succeeded) {
+      resolve(promise, value);
+    } else if (failed) {
+      reject(promise, error);
+    } else if (settled === FULFILLED) {
+      fulfill(promise, value);
+    } else if (settled === REJECTED) {
+      reject(promise, value);
+    }
+  }
+
+  function initializePromise(promise, resolver) {
+    try {
+      resolver(function resolvePromise(value) {
+        resolve(promise, value);
+      }, function rejectPromise(reason) {
+        reject(promise, reason);
+      });
+    } catch (e) {
+      reject(promise, e);
+    }
+  }
+
+  var id = 0;
+  function nextId() {
+    return id++;
+  }
+
+  function makePromise(promise) {
+    promise[PROMISE_ID] = id++;
+    promise._state = undefined;
+    promise._result = undefined;
+    promise._subscribers = [];
+  }
+
+  function validationError() {
+    return new Error('Array Methods must be provided an Array');
+  }
+
+  var Enumerator = function () {
+    function Enumerator(Constructor, input) {
+      this._instanceConstructor = Constructor;
+      this.promise = new Constructor(noop);
+
+      if (!this.promise[PROMISE_ID]) {
+        makePromise(this.promise);
+      }
+
+      if (isArray(input)) {
+        this.length = input.length;
+        this._remaining = input.length;
+
+        this._result = new Array(this.length);
+
+        if (this.length === 0) {
+          fulfill(this.promise, this._result);
+        } else {
+          this.length = this.length || 0;
+          this._enumerate(input);
+          if (this._remaining === 0) {
+            fulfill(this.promise, this._result);
+          }
+        }
+      } else {
+        reject(this.promise, validationError());
+      }
+    }
+
+    Enumerator.prototype._enumerate = function _enumerate(input) {
+      for (var i = 0; this._state === PENDING && i < input.length; i++) {
+        this._eachEntry(input[i], i);
+      }
+    };
+
+    Enumerator.prototype._eachEntry = function _eachEntry(entry, i) {
+      var c = this._instanceConstructor;
+      var resolve$$1 = c.resolve;
+
+
+      if (resolve$$1 === resolve$1) {
+        var _then = getThen(entry);
+
+        if (_then === then && entry._state !== PENDING) {
+          this._settledAt(entry._state, i, entry._result);
+        } else if (typeof _then !== 'function') {
+          this._remaining--;
+          this._result[i] = entry;
+        } else if (c === Promise$2) {
+          var promise = new c(noop);
+          handleMaybeThenable(promise, entry, _then);
+          this._willSettleAt(promise, i);
+        } else {
+          this._willSettleAt(new c(function (resolve$$1) {
+            return resolve$$1(entry);
+          }), i);
+        }
+      } else {
+        this._willSettleAt(resolve$$1(entry), i);
+      }
+    };
+
+    Enumerator.prototype._settledAt = function _settledAt(state, i, value) {
+      var promise = this.promise;
+
+
+      if (promise._state === PENDING) {
+        this._remaining--;
+
+        if (state === REJECTED) {
+          reject(promise, value);
+        } else {
+          this._result[i] = value;
+        }
+      }
+
+      if (this._remaining === 0) {
+        fulfill(promise, this._result);
+      }
+    };
+
+    Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {
+      var enumerator = this;
+
+      subscribe(promise, undefined, function (value) {
+        return enumerator._settledAt(FULFILLED, i, value);
+      }, function (reason) {
+        return enumerator._settledAt(REJECTED, i, reason);
+      });
+    };
+
+    return Enumerator;
+  }();
+
+  /**
+    `Promise.all` accepts an array of promises, and returns a new promise which
+    is fulfilled with an array of fulfillment values for the passed promises, or
+    rejected with the reason of the first passed promise to be rejected. It casts all
+    elements of the passed iterable to promises as it runs this algorithm.
+    Example:
+    ```javascript
+    let promise1 = resolve(1);
+    let promise2 = resolve(2);
+    let promise3 = resolve(3);
+    let promises = [ promise1, promise2, promise3 ];
+    Promise.all(promises).then(function(array){
+      // The array here would be [ 1, 2, 3 ];
+    });
+    ```
+    If any of the `promises` given to `all` are rejected, the first promise
+    that is rejected will be given as an argument to the returned promises's
+    rejection handler. For example:
+    Example:
+    ```javascript
+    let promise1 = resolve(1);
+    let promise2 = reject(new Error("2"));
+    let promise3 = reject(new Error("3"));
+    let promises = [ promise1, promise2, promise3 ];
+    Promise.all(promises).then(function(array){
+      // Code here never runs because there are rejected promises!
+    }, function(error) {
+      // error.message === "2"
+    });
+    ```
+    @method all
+    @static
+    @param {Array} entries array of promises
+    @param {String} label optional string for labeling the promise.
+    Useful for tooling.
+    @return {Promise} promise that is fulfilled when all `promises` have been
+    fulfilled, or rejected if any of them become rejected.
+    @static
+  */
+  function all(entries) {
+    return new Enumerator(this, entries).promise;
+  }
+
+  /**
+    `Promise.race` returns a new promise which is settled in the same way as the
+    first passed promise to settle.
+    Example:
+    ```javascript
+    let promise1 = new Promise(function(resolve, reject){
+      setTimeout(function(){
+        resolve('promise 1');
+      }, 200);
+    });
+    let promise2 = new Promise(function(resolve, reject){
+      setTimeout(function(){
+        resolve('promise 2');
+      }, 100);
+    });
+    Promise.race([promise1, promise2]).then(function(result){
+      // result === 'promise 2' because it was resolved before promise1
+      // was resolved.
+    });
+    ```
+    `Promise.race` is deterministic in that only the state of the first
+    settled promise matters. For example, even if other promises given to the
+    `promises` array argument are resolved, but the first settled promise has
+    become rejected before the other promises became fulfilled, the returned
+    promise will become rejected:
+    ```javascript
+    let promise1 = new Promise(function(resolve, reject){
+      setTimeout(function(){
+        resolve('promise 1');
+      }, 200);
+    });
+    let promise2 = new Promise(function(resolve, reject){
+      setTimeout(function(){
+        reject(new Error('promise 2'));
+      }, 100);
+    });
+    Promise.race([promise1, promise2]).then(function(result){
+      // Code here never runs
+    }, function(reason){
+      // reason.message === 'promise 2' because promise 2 became rejected before
+      // promise 1 became fulfilled
+    });
+    ```
+    An example real-world use case is implementing timeouts:
+    ```javascript
+    Promise.race([ajax('foo.json'), timeout(5000)])
+    ```
+    @method race
+    @static
+    @param {Array} promises array of promises to observe
+    Useful for tooling.
+    @return {Promise} a promise which settles in the same way as the first passed
+    promise to settle.
+  */
+  function race(entries) {
+    /*jshint validthis:true */
+    var Constructor = this;
+
+    if (!isArray(entries)) {
+      return new Constructor(function (_, reject) {
+        return reject(new TypeError('You must pass an array to race.'));
+      });
+    } else {
+      return new Constructor(function (resolve, reject) {
+        var length = entries.length;
+        for (var i = 0; i < length; i++) {
+          Constructor.resolve(entries[i]).then(resolve, reject);
+        }
+      });
+    }
+  }
+
+  /**
+    `Promise.reject` returns a promise rejected with the passed `reason`.
+    It is shorthand for the following:
+    ```javascript
+    let promise = new Promise(function(resolve, reject){
+      reject(new Error('WHOOPS'));
+    });
+    promise.then(function(value){
+      // Code here doesn't run because the promise is rejected!
+    }, function(reason){
+      // reason.message === 'WHOOPS'
+    });
+    ```
+    Instead of writing the above, your code now simply becomes the following:
+    ```javascript
+    let promise = Promise.reject(new Error('WHOOPS'));
+    promise.then(function(value){
+      // Code here doesn't run because the promise is rejected!
+    }, function(reason){
+      // reason.message === 'WHOOPS'
+    });
+    ```
+    @method reject
+    @static
+    @param {Any} reason value that the returned promise will be rejected with.
+    Useful for tooling.
+    @return {Promise} a promise rejected with the given `reason`.
+  */
+  function reject$1(reason) {
+    /*jshint validthis:true */
+    var Constructor = this;
+    var promise = new Constructor(noop);
+    reject(promise, reason);
+    return promise;
+  }
+
+  function needsResolver() {
+    throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
+  }
+
+  function needsNew() {
+    throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
+  }
+
+  /**
+    Promise objects represent the eventual result of an asynchronous operation. The
+    primary way of interacting with a promise is through its `then` method, which
+    registers callbacks to receive either a promise's eventual value or the reason
+    why the promise cannot be fulfilled.
+    Terminology
+    -----------
+    - `promise` is an object or function with a `then` method whose behavior conforms to this specification.
+    - `thenable` is an object or function that defines a `then` method.
+    - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).
+    - `exception` is a value that is thrown using the throw statement.
+    - `reason` is a value that indicates why a promise was rejected.
+    - `settled` the final resting state of a promise, fulfilled or rejected.
+    A promise can be in one of three states: pending, fulfilled, or rejected.
+    Promises that are fulfilled have a fulfillment value and are in the fulfilled
+    state.  Promises that are rejected have a rejection reason and are in the
+    rejected state.  A fulfillment value is never a thenable.
+    Promises can also be said to *resolve* a value.  If this value is also a
+    promise, then the original promise's settled state will match the value's
+    settled state.  So a promise that *resolves* a promise that rejects will
+    itself reject, and a promise that *resolves* a promise that fulfills will
+    itself fulfill.
+    Basic Usage:
+    ------------
+    ```js
+    let promise = new Promise(function(resolve, reject) {
+      // on success
+      resolve(value);
+      // on failure
+      reject(reason);
+    });
+    promise.then(function(value) {
+      // on fulfillment
+    }, function(reason) {
+      // on rejection
+    });
+    ```
+    Advanced Usage:
+    ---------------
+    Promises shine when abstracting away asynchronous interactions such as
+    `XMLHttpRequest`s.
+    ```js
+    function getJSON(url) {
+      return new Promise(function(resolve, reject){
+        let xhr = new XMLHttpRequest();
+        xhr.open('GET', url);
+        xhr.onreadystatechange = handler;
+        xhr.responseType = 'json';
+        xhr.setRequestHeader('Accept', 'application/json');
+        xhr.send();
+        function handler() {
+          if (this.readyState === this.DONE) {
+            if (this.status === 200) {
+              resolve(this.response);
+            } else {
+              reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));
+            }
+          }
+        };
+      });
+    }
+    getJSON('/posts.json').then(function(json) {
+      // on fulfillment
+    }, function(reason) {
+      // on rejection
+    });
+    ```
+    Unlike callbacks, promises are great composable primitives.
+    ```js
+    Promise.all([
+      getJSON('/posts'),
+      getJSON('/comments')
+    ]).then(function(values){
+      values[0] // => postsJSON
+      values[1] // => commentsJSON
+      return values;
+    });
+    ```
+    @class Promise
+    @param {Function} resolver
+    Useful for tooling.
+    @constructor
+  */
+
+  var Promise$2 = function () {
+    function Promise(resolver) {
+      this[PROMISE_ID] = nextId();
+      this._result = this._state = undefined;
+      this._subscribers = [];
+
+      if (noop !== resolver) {
+        typeof resolver !== 'function' && needsResolver();
+        this instanceof Promise ? initializePromise(this, resolver) : needsNew();
+      }
+    }
+
+    /**
+    The primary way of interacting with a promise is through its `then` method,
+    which registers callbacks to receive either a promise's eventual value or the
+    reason why the promise cannot be fulfilled.
+     ```js
+    findUser().then(function(user){
+      // user is available
+    }, function(reason){
+      // user is unavailable, and you are given the reason why
+    });
+    ```
+     Chaining
+    --------
+     The return value of `then` is itself a promise.  This second, 'downstream'
+    promise is resolved with the return value of the first promise's fulfillment
+    or rejection handler, or rejected if the handler throws an exception.
+     ```js
+    findUser().then(function (user) {
+      return user.name;
+    }, function (reason) {
+      return 'default name';
+    }).then(function (userName) {
+      // If `findUser` fulfilled, `userName` will be the user's name, otherwise it
+      // will be `'default name'`
+    });
+     findUser().then(function (user) {
+      throw new Error('Found user, but still unhappy');
+    }, function (reason) {
+      throw new Error('`findUser` rejected and we're unhappy');
+    }).then(function (value) {
+      // never reached
+    }, function (reason) {
+      // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.
+      // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.
+    });
+    ```
+    If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.
+     ```js
+    findUser().then(function (user) {
+      throw new PedagogicalException('Upstream error');
+    }).then(function (value) {
+      // never reached
+    }).then(function (value) {
+      // never reached
+    }, function (reason) {
+      // The `PedgagocialException` is propagated all the way down to here
+    });
+    ```
+     Assimilation
+    ------------
+     Sometimes the value you want to propagate to a downstream promise can only be
+    retrieved asynchronously. This can be achieved by returning a promise in the
+    fulfillment or rejection handler. The downstream promise will then be pending
+    until the returned promise is settled. This is called *assimilation*.
+     ```js
+    findUser().then(function (user) {
+      return findCommentsByAuthor(user);
+    }).then(function (comments) {
+      // The user's comments are now available
+    });
+    ```
+     If the assimliated promise rejects, then the downstream promise will also reject.
+     ```js
+    findUser().then(function (user) {
+      return findCommentsByAuthor(user);
+    }).then(function (comments) {
+      // If `findCommentsByAuthor` fulfills, we'll have the value here
+    }, function (reason) {
+      // If `findCommentsByAuthor` rejects, we'll have the reason here
+    });
+    ```
+     Simple Example
+    --------------
+     Synchronous Example
+     ```javascript
+    let result;
+     try {
+      result = findResult();
+      // success
+    } catch(reason) {
+      // failure
+    }
+    ```
+     Errback Example
+     ```js
+    findResult(function(result, err){
+      if (err) {
+        // failure
+      } else {
+        // success
+      }
+    });
+    ```
+     Promise Example;
+     ```javascript
+    findResult().then(function(result){
+      // success
+    }, function(reason){
+      // failure
+    });
+    ```
+     Advanced Example
+    --------------
+     Synchronous Example
+     ```javascript
+    let author, books;
+     try {
+      author = findAuthor();
+      books  = findBooksByAuthor(author);
+      // success
+    } catch(reason) {
+      // failure
+    }
+    ```
+     Errback Example
+     ```js
+     function foundBooks(books) {
+     }
+     function failure(reason) {
+     }
+     findAuthor(function(author, err){
+      if (err) {
+        failure(err);
+        // failure
+      } else {
+        try {
+          findBoooksByAuthor(author, function(books, err) {
+            if (err) {
+              failure(err);
+            } else {
+              try {
+                foundBooks(books);
+              } catch(reason) {
+                failure(reason);
+              }
+            }
+          });
+        } catch(error) {
+          failure(err);
+        }
+        // success
+      }
+    });
+    ```
+     Promise Example;
+     ```javascript
+    findAuthor().
+      then(findBooksByAuthor).
+      then(function(books){
+        // found books
+    }).catch(function(reason){
+      // something went wrong
+    });
+    ```
+     @method then
+    @param {Function} onFulfilled
+    @param {Function} onRejected
+    Useful for tooling.
+    @return {Promise}
+    */
+
+    /**
+    `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same
+    as the catch block of a try/catch statement.
+    ```js
+    function findAuthor(){
+    throw new Error('couldn't find that author');
+    }
+    // synchronous
+    try {
+    findAuthor();
+    } catch(reason) {
+    // something went wrong
+    }
+    // async with promises
+    findAuthor().catch(function(reason){
+    // something went wrong
+    });
+    ```
+    @method catch
+    @param {Function} onRejection
+    Useful for tooling.
+    @return {Promise}
+    */
+
+
+    Promise.prototype.catch = function _catch(onRejection) {
+      return this.then(null, onRejection);
+    };
+
+    /**
+      `finally` will be invoked regardless of the promise's fate just as native
+      try/catch/finally behaves
+    
+      Synchronous example:
+    
+      ```js
+      findAuthor() {
+        if (Math.random() > 0.5) {
+          throw new Error();
+        }
+        return new Author();
+      }
+    
+      try {
+        return findAuthor(); // succeed or fail
+      } catch(error) {
+        return findOtherAuther();
+      } finally {
+        // always runs
+        // doesn't affect the return value
+      }
+      ```
+    
+      Asynchronous example:
+    
+      ```js
+      findAuthor().catch(function(reason){
+        return findOtherAuther();
+      }).finally(function(){
+        // author was either found, or not
+      });
+      ```
+    
+      @method finally
+      @param {Function} callback
+      @return {Promise}
+    */
+
+
+    Promise.prototype.finally = function _finally(callback) {
+      var promise = this;
+      var constructor = promise.constructor;
+
+      return promise.then(function (value) {
+        return constructor.resolve(callback()).then(function () {
+          return value;
+        });
+      }, function (reason) {
+        return constructor.resolve(callback()).then(function () {
+          throw reason;
+        });
+      });
+    };
+
+    return Promise;
+  }();
+
+  Promise$2.prototype.then = then;
+  Promise$2.all = all;
+  Promise$2.race = race;
+  Promise$2.resolve = resolve$1;
+  Promise$2.reject = reject$1;
+  Promise$2._setScheduler = setScheduler;
+  Promise$2._setAsap = setAsap;
+  Promise$2._asap = asap;
+
+  /*global self*/
+  function polyfill() {
+    var local = void 0;
+
+    if (typeof global !== 'undefined') {
+      local = global;
+    } else if (typeof self !== 'undefined') {
+      local = self;
+    } else {
+      try {
+        local = Function('return this')();
+      } catch (e) {
+        throw new Error('polyfill failed because global object is unavailable in this environment');
+      }
+    }
+
+    var P = local.Promise;
+
+    if (P) {
+      var promiseToString = null;
+      try {
+        promiseToString = Object.prototype.toString.call(P.resolve());
+      } catch (e) {
+        // silently ignored
+      }
+
+      if (promiseToString === '[object Promise]' && !P.cast) {
+        return;
+      }
+    }
+
+    local.Promise = Promise$2;
+  }
+
+  // Strange compat..
+  Promise$2.polyfill = polyfill;
+  Promise$2.Promise = Promise$2;
+
+  Promise$2.polyfill();
+
+  return Promise$2;
+
+})));
+
+
+
+//# sourceMappingURL=es6-promise.auto.map

+ 99 - 0
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/utils/js.js

@@ -0,0 +1,99 @@
+//引入Promise
+var Promise = require('./es6-promise.auto.js');
+var token = wx.getStorageSync('token')
+function wxPromisify(fn) {
+  return function (obj = {}) {
+    return new Promise((resolve, reject) => {
+      obj.success = function (res) {
+        //成功
+        resolve(res)
+      }
+      obj.fail = function (res) {
+        //失败
+        reject(res)
+      }
+      fn(obj)
+    })
+  }
+}
+//无论promise对象最后状态如何都会执行
+Promise.prototype.finally = function (callback) {
+  let P = this.constructor;
+  return this.then(
+    value => P.resolve(callback()).then(() => value),
+    reason => P.resolve(callback()).then(() => { throw reason })
+  );
+};
+/** get请求方法 **/
+function syncGet(url, data) {
+  var syncGet = wxPromisify(wx.request)
+  return syncGet({
+    url: url,
+    method: 'GET',
+    data: data,
+    header: { 'Content-Type': 'application/json' }
+  })
+}
+/** post请求方法封装 **/
+function syncPost(url, data) {
+  var syncPost = wxPromisify(wx.request)
+  return syncPost({
+    url: url,
+    method: 'POST',
+    data: data,
+    header: { "content-type": "application/x-www-form-urlencoded", 'token': token},
+  })
+}
+//用户登录
+function login() {
+  return new Promise((resolve, reject) => wx.login({
+    success: resolve,
+    fail: reject
+  }))
+}
+//获取用户信息
+function getUserInfo() {
+  return new Promise((resolve, reject) => wx.getUserInfo({
+    success: resolve,
+    fail: reject
+  }))
+}
+//获取用户当前经纬度
+function getLocation(){
+  var getLocation = wxPromisify(wx.getLocation)
+  return getLocation({
+    type: 'gcj02',
+  })
+}
+//获取当前地图的缩放值
+function getScale(){
+  return getScale = new Promise(function (resolve, reject) {
+    //做一些异步操作
+    var mapCtx = wx.createMapContext("map");
+    mapCtx.getScale({
+      type: 'gcj02',
+      success: resolve,
+      fail: reject
+    })
+  });
+}
+//获取当前地图的缩放值
+function getScale() {
+  return getScale = new Promise(function (resolve, reject) {
+    //做一些异步操作
+    var mapCtx = wx.createMapContext("map");
+    mapCtx.getScale({
+      type: 'gcj02',
+      success: resolve,
+      fail: reject
+    })
+  });
+}
+module.exports = {
+  syncPost: syncPost,
+  syncGet: syncGet,
+  login: login,
+  getUserInfo: getUserInfo,
+  getLocation: getLocation,
+  getScale: getScale,
+}

+ 121 - 0
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/utils/util.js

@@ -0,0 +1,121 @@
+//获取系统的时间
+var days = []
+const formatNumber = n => {
+  n = n.toString()
+  return n[1] ? n : '0' + n
+}
+//当前时间-数组模式 年月日 时分秒
+const nowDateTime = 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()
+  const nowTime = [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':')//整合时间
+  const time = {
+    'year': year, 'month': month, 'day': day, 'hour': hour, 'minute': minute, 'second': second, 'nowTime': nowTime
+  }
+  return time
+}
+//当前时间-数组模式 年月日
+const nowDate = date => {
+  const year = date.getFullYear()
+  const month = date.getMonth() + 1
+  const day = date.getDate()
+  return [year, month, day].map(formatNumber).join('-')
+
+}
+// 从 todate 开始计算 days 天的日期数组
+function dateArry(todate,days) {
+  var dateArry = [];
+  for (var i = 0; i < days; i++) {
+    var dateObj = dateLater(todate, i);
+    dateArry.push(dateObj)
+  }
+  return dateArry;
+}
+function dateLater(dates, later) {
+  let dateObj = {};
+  let day_week = new Array('周日', '周一', '周二', '周三', '周四', '周五', '周六');
+  let day_index = new Array(7, 1, 2, 3, 4, 5, 6);
+  let date = new Date(dates);
+  date.setDate(date.getDate() + later);
+  let day = date.getDay();
+  let yearDate = date.getFullYear();
+  let month = ((date.getMonth() + 1) < 10 ? ("0" + (date.getMonth() + 1)) : date.getMonth() + 1);
+  let dayFormate = (date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate());
+  days = days.concat(dayFormate)
+  dateObj.date = yearDate + '-' + month + '-' + dayFormate;
+  dateObj.week = day_week[day];
+  dateObj.num = day_index[day];
+  dateObj.day = days[day];
+  
+  return dateObj;
+}
+//往后/前推几天的日期
+function delayDate(today, addDayCount) {
+  var dd;
+  if (today) {
+    dd = new Date(today);
+  } else {
+    dd = new Date();
+  }
+  dd.setDate(dd.getDate() + addDayCount);//获取addDayCount天后的日期 
+  var y = dd.getFullYear();
+  var m = dd.getMonth() + 1;//获取当前月份的日期 
+  var d = dd.getDate();
+  if (m < 10) {
+    m = '0' + m;
+  };
+  if (d < 10) {
+    d = '0' + d;
+  };
+  var newDay = y + '-' + m + '-' + d
+  return newDay;
+}
+//当前周的数组
+function nowWeek(day) {
+  var nowWeekArry = {}
+    , nowDate = day //当前日期
+    , num = dateArry(nowDate,1)[0].num //当前周几
+    , monday = delayDate(nowDate, -(num - 1)) //本周一的 日期
+    , sunday = delayDate(nowDate, 7 - num) //本周日的 日期
+    , nowWeek = dateArry(monday,7) //本周列表
+  console.log(num)
+  nowWeekArry = {
+    'nowDate': nowDate //当前日期
+    , 'num': num //当前周几
+    , 'nowWeek': nowWeek //本周列表
+  }
+  return nowWeekArry
+}
+
+//一周的几号重组
+function weekData(weekData) {
+  var weekData = weekData
+  for (let i = 0; i < weekData.length; i++) {
+    var day = weekData[i].date
+    weekData[i].day = day.substr(8, 2)
+  }
+  return weekData;
+}
+//日期转整型
+function date(date) {
+  var a = parseInt(date.substr(0, 4) + date.substr(5, 2) + date.substr(8, 2))
+  return a;
+}
+function toFix(value) {
+  return value.toFixed(2) // 此处2为保留两位小数,保留几位小数,这里写几    
+}
+module.exports = {
+  nowDateTime: nowDateTime //年月日 时分秒
+  , nowDate: nowDate //年月日
+  , dateArry: dateArry // 从 todate 开始计算 days 天的日期数组
+  , delayDate: delayDate //往后/前推几天的日期
+  , date: date  //日期转整型
+  , weekData: weekData //一周的几号重组
+  , nowWeek: nowWeek
+  , toFix: toFix
+  //,box: box
+}

BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/00.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/01.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/02.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/03.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/04.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/05.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/06.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/07.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/08.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/09.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/10.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/100.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/101.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/102.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/103.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/104.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/105.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/106.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/107.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/108.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/109.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/11.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/110.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/111.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/112.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/113.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/114.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/115.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/116.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/117.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/118.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/119.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/12.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/120.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/121.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/122.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/123.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/124.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/125.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/126.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/127.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/128.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/129.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/13.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/130.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/131.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/132.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/133.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/134.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/14.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/15.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/16.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/17.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/18.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/19.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/20.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/21.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/22.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/23.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/24.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/25.gif


BIN
addons/AuthLoginWithWechatAndMobile-master/application/api/minapp_v2/wxParse/emojis/26.gif


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff