From dd339669531db880a8251fedeaaff555b2a3421c Mon Sep 17 00:00:00 2001 From: Anyon Date: Sat, 7 Nov 2020 23:25:43 +0800 Subject: [PATCH] Update Js.php --- app/wechat/controller/api/Js.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/wechat/controller/api/Js.php b/app/wechat/controller/api/Js.php index e3b9015bf..4d3a8c12e 100644 --- a/app/wechat/controller/api/Js.php +++ b/app/wechat/controller/api/Js.php @@ -60,6 +60,21 @@ class Js extends Controller return Response::create($content)->contentType('application/x-javascript'); } + /** + * 给指定地址创建签名参数 + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + * @throws \think\Exception + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function sdk() + { + $data = $this->_vali(['url.require' => '签名地址不能为空!']); + $this->success('获取签名参数', WechatService::instance()->getWebJssdkSign($data['url'])); + } + /** * 生成授权内容 * @return string