Authored by 毕凯

Merge branch 'master' of git.yoho.cn:fe/YOHOBUYWAP

<?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();
}
}
\ No newline at end of file
... ...