Authored by 毕凯

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-W958MG" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>
var _hmt = _hmt || [];
(function() {
... ... @@ -10,7 +9,6 @@ var _hmt = _hmt || [];
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-W958MG');
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?c6ee7218b8321cb65fb2e98f284d8311";
... ... @@ -18,7 +16,6 @@ var _hmt = _hmt || [];
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?65dd99e0435a55177ffda862198ce841";
... ... @@ -26,7 +23,6 @@ var _hmt = _hmt || [];
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
(function() {
var hm = document.createElement("script");
hm.src = "http://static.yohobuy.com/js/analytics/analysis.js";
... ... @@ -38,28 +34,6 @@ var _hmt = _hmt || [];
window.addEventListener('load', async_load, false);
})();
</script>
<<<<<<< HEAD
<!-- End Google Tag Manager -->
<script type="text/javascript">
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?c6ee7218b8321cb65fb2e98f284d8311";
hm.async = 1;
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?65dd99e0435a55177ffda862198ce841";
hm.async = 1;
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script>
window._py = window._py||[];
window._py.push(['a', 'MC..o8vMMWxEXDCiqYckD81lUX']);
... ... @@ -73,5 +47,4 @@ var _hmt = _hmt || [];
var h = d.getElementsByTagName("script")[0];h.parentNode.insertBefore(c, h);
}(document);
</script>
<script src="http://static.yohobuy.com/js/analytics/analysis.js" async="async"></script>
<script src="http://static.yohobuy.com/m/v1/js/om_code.js" async="async"></script>
\ No newline at end of file
... ...
... ... @@ -17,6 +17,9 @@ class LoginController extends AbstractAction
*/
public function indexAction()
{
// 设置登录有效时间30分钟, 防机器刷
$this->setSession('_LOGIN_EXPIRE', time() + 1800);
// 清除客户端
$this->setCookie('_UID', '');
$this->setCookie('_TOKEN', '');
... ... @@ -44,9 +47,6 @@ class LoginController extends AbstractAction
// 渲染模板
$this->_view->display('index', $data);
// 设置登录有效时间30分钟, 防机器刷
$this->setSession('_LOGIN_EXPIRE', time() + 1800);
}
/**
... ... @@ -54,6 +54,9 @@ class LoginController extends AbstractAction
*/
public function internationalAction()
{
// 设置登录有效时间30分钟, 防机器刷
$this->setSession('_LOGIN_EXPIRE', time() + 1800);
$refer = $this->get('refer');
if (!empty($refer)) {
$this->setCookie('refer', $refer);
... ... @@ -70,9 +73,6 @@ class LoginController extends AbstractAction
$data['countrys'] = RegData::getAreasData(); // 地区信息列表
// 渲染模板
$this->_view->display('international', $data);
// 设置登录有效时间30分钟, 防机器刷
$this->setSession('_LOGIN_EXPIRE', time() + 1800);
}
/**
... ... @@ -129,13 +129,13 @@ class LoginController extends AbstractAction
if (!$verifyEmail && !$verifyMobile) {
break;
}
/* 设置登录有效时间30分钟, 防机器刷 */
$expire = $this->getSession('_LOGIN_EXPIRE');
if (empty($expire) || $expire < time()) {
break;
}
/* 调用登录接口进行登录 */
// 获取未登录时的唯一识别码
$shoppingKey = Helpers::getShoppingKeyByCookie();
... ... @@ -157,7 +157,6 @@ class LoginController extends AbstractAction
$this->setCookie('_TOKEN', $token);
$this->setSession('_TOKEN', $token);
$this->setSession('_LOGIN_UID', $data['data']['uid']);
} while (false);
$this->echoJson($data);
... ... @@ -226,9 +225,9 @@ class LoginController extends AbstractAction
if (isset($result['code']) && $result['code'] == 200 && !empty($result['data']['uid'])) {
$token = Helpers::makeToken($result['data']['uid']);
$this->setCookie('_TOKEN', $token);
$this->setSession('_TOKEN', $token);
$this->setSession('_LOGIN_UID', $result['data']['uid']);
$this->setCookie('_TOKEN', $token);
$this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
} else {
$this->go($refer);
... ... @@ -264,9 +263,9 @@ class LoginController extends AbstractAction
if (isset($result['code']) && $result['code'] == 200 && !empty($result['data']['uid'])) {
$token = Helpers::makeToken($result['data']['uid']);
$this->setCookie('_TOKEN', $token);
$this->setSession('_TOKEN', $token);
$this->setSession('_LOGIN_UID', $result['data']['uid']);
$this->setCookie('_TOKEN', $token);
$this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
} else {
$this->go($refer);
... ... @@ -302,9 +301,9 @@ class LoginController extends AbstractAction
if (isset($result['code']) && $result['code'] == 200 && !empty($result['data']['uid'])) {
$token = Helpers::makeToken($result['data']['uid']);
$this->setCookie('_TOKEN', $token);
$this->setSession('_TOKEN', $token);
$this->setSession('_LOGIN_UID', $result['data']['uid']);
$this->setCookie('_TOKEN', $token);
$this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
} else {
$this->go($refer);
... ...