正在显示
1 个修改的文件
包含
9 行增加
和
2 行删除
@@ -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 | } |
-
请 注册 或 登录 后发表评论