作者 何书鹏
1 个管道 的构建 通过 耗费 2 秒

1

@@ -12,7 +12,7 @@ use EasyWeChat\Factory; @@ -12,7 +12,7 @@ use EasyWeChat\Factory;
12 */ 12 */
13 class Index extends Api 13 class Index extends Api
14 { 14 {
15 - protected $noNeedLogin = ['index','info','jssdk']; 15 + protected $noNeedLogin = ['index','info','jssdk','jssdk1'];
16 protected $noNeedRight = ['*']; 16 protected $noNeedRight = ['*'];
17 17
18 /** 18 /**
@@ -96,12 +96,19 @@ class Index extends Api @@ -96,12 +96,19 @@ class Index extends Api
96 96
97 public function jssdk() 97 public function jssdk()
98 { 98 {
  99 + $params = $this->request->post();
99 $apis = [ 100 $apis = [
100 'checkJsApi', 101 'checkJsApi',
101 'getLocation', //获取位置 102 'getLocation', //获取位置
102 'openLocation', //打开位置 103 'openLocation', //打开位置
103 ]; 104 ];
104 - $res = Factory::officialAccount(config('wechat'))->jssdk->setUrl('http://parking.h.brofirst.cn')->buildConfig($apis, $debug = true, $beta = false, $json = false); 105 + $uri = urldecode($params['uri']);
  106 + $res = Factory::officialAccount(config('wechat'))->jssdk->setUrl($uri)->buildConfig($apis, $debug = true, $beta = false, $json = false);
105 $this->success('sdk', $res); 107 $this->success('sdk', $res);
106 } 108 }
  109 +
  110 + public function jssdk1()
  111 + {
  112 + halt(Factory::officialAccount(config('wechat'))->jssdk->getTicket());
  113 + }
107 } 114 }