From e1e39b0023457ed70bfd27e6db4b0449b3214a48 Mon Sep 17 00:00:00 2001 From: Anyon Date: Mon, 19 Mar 2018 15:38:32 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E5=A2=9E=E5=8A=A0=E5=8F=88?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E7=BD=91=E9=A1=B5=E6=8E=88=E6=9D=83=E5=85=BC?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/Wechat.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/application/index/controller/Wechat.php b/application/index/controller/Wechat.php index 6ed974b6e..e6bbd5b00 100644 --- a/application/index/controller/Wechat.php +++ b/application/index/controller/Wechat.php @@ -36,4 +36,16 @@ class Wechat extends Controller return $this->fetch('wechat@api/tools/oauth', ['fans' => $fans]); } + /** + * 网页JSSDK测试 + * @return mixed + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function jssdk() + { + $wechat = WechatService::script(); + $options = $wechat->getJsSign($this->request->url(true)); + return $this->fetch('wechat@api/tools/jssdk', ['options' => $options]); + } } \ No newline at end of file