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