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