Toyota.php
1.08 KB
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
44
45
<?php
use Action\HuodongAction;
class ToyotaController extends HuodongAction
{
private $callbackurl = 'http://m.yohobuy.com/events/get?ref=';
/**
* 获取微信跳转地址
*
* @return string
*/
public function getwechaturlAction()
{
$url = $this->get('url', '');
if(!empty($url))
{
$host = parse_url($url);
if(preg_match('@yoho.cn@i', $host['host']) || preg_match('@yohobuy.com@i', $host['host']) )
{
header('location:'.$this->callbackurl.urlencode($url));
}
else
{
header('location:http://m.yohobuy.com');
}
}
exit();
}
/**
* 获取微信信息
*
* @return string
*/
public function getwechatinfoAction()
{
$callback = $this->get('callback', '');
$wx_info = isset($_COOKIE['wxinfo']) ? $_COOKIE['wxinfo']: '';
header('Content-Type: application/json; charset=utf-8;');
echo $callback, '(';
echo $wx_info;
echo ')';
exit();
}
}