AuthController.class.php
976 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
* 前台选人组件 JsSdk 权限验证
* AuthChooseController.class.php
* $author$ 何岳龙
* $date$ 2016年8月29日11:26:24
*/
namespace Api\Controller\ChooseMem;
use VcySDK\Service;
use VcySDK\WxQy\WebAuth;
class AuthController extends AbstractController
{
public function Index()
{
// 获取GET参数
$get = I('get.');
// 实例化
$service = new WebAuth(Service::instance());
// 获取url
$url = isset($_SERVER['HTTP_REFERER']) ? preg_replace('/(#.+?)$/', '', $_SERVER['HTTP_REFERER']) : '';
// 如果随机字符和时间戳存在
if (!empty($get['noncestr']) && !empty($get['timestamp'])) {
$condition['noncestr'] = $get['noncestr'];
$condition['time'] = $get['timestamp'];
}
$condition['url'] = $url;
// 获取返回数据
$this->_result = $service->jsGroupSignAture($condition);
return true;
}
}