From 677953dbc296f771a0913914ec2b4e1f7af3f426 Mon Sep 17 00:00:00 2001 From: Anyon Date: Sat, 17 Mar 2018 12:12:00 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E5=A2=9E=E5=8A=A0=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E6=B5=8B=E8=AF=95=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/wechat/controller/api/Tools.php | 13 +++++- application/wechat/view/api/tools/jssdk.html | 42 ++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 application/wechat/view/api/tools/jssdk.html diff --git a/application/wechat/controller/api/Tools.php b/application/wechat/controller/api/Tools.php index a599ec77c..f24686f11 100644 --- a/application/wechat/controller/api/Tools.php +++ b/application/wechat/controller/api/Tools.php @@ -26,7 +26,7 @@ class Tools extends BasicAdmin { /** * 网页授权测试 - * @return mixed + * @return string * @throws \think\Exception * @throws \think\exception\PDOException */ @@ -36,4 +36,15 @@ class Tools extends BasicAdmin return $this->fetch('', ['fans' => $fans]); } + /** + * JSSDK测试 + * @return string + */ + public function jssdk() + { + $wechat = WechatService::wechat(); + $options = $wechat->jsSign($this->request->url(true)); + return $this->fetch('', ['options' => $options]); + } + } \ No newline at end of file diff --git a/application/wechat/view/api/tools/jssdk.html b/application/wechat/view/api/tools/jssdk.html new file mode 100644 index 000000000..461e99364 --- /dev/null +++ b/application/wechat/view/api/tools/jssdk.html @@ -0,0 +1,42 @@ + + + + JSSDK签名验证测试 + + + + + + + + + + + +
+

JSSDK 功能测试

+
+ +
+ 调起摄像头扫码 +
+ + + + +