Authored by hf

code review by fei.hong: do add login support https

... ... @@ -800,8 +800,24 @@ class Helpers
*/
public static function syncUserSession($uid, $refer = '', $callback = 'call')
{
return 'http://mapi.yohobuy.com/Passport/session/index?callback=' . $callback
. '&sign=' . md5(md5($uid . 'Js8Yn0!EwPM45-ws')) . '&uid=' . $uid . '&go=' . $refer;
$url = '';
switch (APPLICATION_ENV) {
case 'production':
$url = 'http://mapi.yohobuy.com';
break;
case 'preview':
$url = 'https://login.m.yohobuy.com';
break;
case 'testing':
$url = 'http://m1.yohobuy.com';
break;
default:
$url = 'http://m1.yohobuy.com';
break;
}
$url .= '/Passport/session/index?callback=' . $callback . '&sign=' . md5(md5($uid . 'Js8Yn0!EwPM45-ws')) . '&uid=' . $uid . '&go=' . $refer;
return $url;
}
/**
... ... @@ -809,15 +825,31 @@ class Helpers
*
* 转向老的PHP服务器上处理, 因购物车相关的操作会依赖SESSION
*
* @param int $uid 用户ID
* @param int $token 用户ID
* @param string $refer 访问来源
* @param string $callback 回调方法名
* @return string
*/
public static function logoutSession($token, $refer = '', $callback = 'call')
{
return 'http://mapi.yohobuy.com/Passport/session/logout?callback=' . $callback
. '&sign=' . md5(md5('Js8Yn0!EwPM45-ws')) . '&token=' . $token . '&go=' . $refer;
$url = '';
switch (APPLICATION_ENV) {
case 'production':
$url = 'http://mapi.yohobuy.com';
break;
case 'preview':
$url = 'https://login.m.yohobuy.com';
break;
case 'testing':
$url = 'http://m1.yohobuy.com';
break;
default:
$url = 'http://m1.yohobuy.com';
break;
}
$url .= '/Passport/session/logout?callback=' . $callback . '&sign=' . md5(md5('Js8Yn0!EwPM45-ws')) . '&token=' . $token . '&go=' . $refer;
return $url;
}
/**
... ...
... ... @@ -438,13 +438,18 @@ server
}
location ^~ /dist/ {
#root /Data/PE/yohobuy/yohobuy/static;
#expires 30d;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://cdn.yoho.cn/;
}
location = /Passport/session/index {
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://mapi.yohobuy.com;
}
location ~* \.(ico|woff|svg|eot|ttf|otf)$ {
expires 30d;
}
... ...