Authored by hf

fixes bug to call product detail api and order status

... ... @@ -28,7 +28,6 @@ class Yohobuy
const API_URL = 'http://testapi.yoho.cn:28078/';
const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
const API_URL_LOGINSESSION = 'http://m1.yohobuy.com/';
/**
* 私钥列表
... ...
... ... @@ -4,6 +4,7 @@ namespace LibModels\Wap\Passport;
use Api\Sign;
use Api\Yohobuy;
use Plugin\Helpers;
/**
* 登录的数据模型
... ... @@ -78,15 +79,12 @@ class LoginData
/**
* 登出SESSION会话
*
* @param int $uid 用户ID
* @param string $token 会话
* @return array
*/
public static function signoutSession($token)
{
$param = array();
$param['token'] = $token;
return Yohobuy::get(Yohobuy::API_URL_LOGINSESSION . 'Passport/session/logout', $param);
return Yohobuy::get( Helpers::logoutSession($token) );
}
}
... ...
... ... @@ -525,7 +525,7 @@ class Helpers
public static function getVipLevel($vipInfo)
{
$vipLevel = 0;
switch ($vipInfo) {
case '普通会员':
$vipLevel = 0;
... ... @@ -540,10 +540,10 @@ class Helpers
$vipLevel = 3;
break;
}
return $vipLevel;
}
/**
* 同步用户的会话
*
... ... @@ -554,10 +554,26 @@ class Helpers
* @param string $callback 回调方法名
* @return string
*/
public static function syncUserSession($uid, $refer = '', $callback='call')
public static function syncUserSession($uid, $refer = '', $callback = 'call')
{
return 'http://m1.yohobuy.com/Passport/session/index?callback=' . $callback
return 'http://m1.yohobuy.com/Passport/session/index?callback=' . $callback
. '&sign=' . md5($uid . 'Js8Yn0!EwPM45-ws') . '&uid=' . $uid . '&go=' . $refer;
}
/**
* 退出清除用户的会话
*
* 转向老的PHP服务器上处理, 因购物车相关的操作会依赖SESSION
*
* @param int $uid 用户ID
* @param string $refer 访问来源
* @param string $callback 回调方法名
* @return string
*/
public static function logoutSession($token, $callback = 'call')
{
return 'http://m1.yohobuy.com/Passport/session/logout?callback=' . $callback
. '&sign=' . md5('Js8Yn0!EwPM45-ws') . '&token=' . $token;
}
}
... ...
... ... @@ -86,9 +86,11 @@ class LoginController extends AbstractAction
$this->setCookie('_UID', '');
$refer = $this->server('HTTP_REFERER', SITE_MAIN);
$token = $this->get('token');
LoginData::signoutSession($token);
if (!empty($token)) {
LoginData::signoutSession($token);
}
$this->go($refer);
}
... ...