Authored by Rock Zhang

添加支付时保存用户id到sesion以防止cookie中uid信息丢失

Code Review By Rock Zhang
... ... @@ -366,7 +366,10 @@ class NoticeController extends WebAction
$log->LogInfo(var_export($payResult, true));
//判断是否登录
$uid = $this->auditJumpLogin();
$uid = $this->getUid();
if (empty($uid)) { // cookie中获取为空时再从之前保存的session中获取
$uid = $this->getSession('payUserid');
}
$log->LogInfo('================已登录,获取到用户ID============');
... ...
... ... @@ -25,6 +25,8 @@ class PayController extends WebAction
if (!$uid) {
$this->go( Helpers::url('/signin.html', array('refer' => $this->server('HTTP_REFERER', SITE_MAIN))) );
}
// 将用户UID存入session中以便支付成功回调使用
$this->setSession('payUserid', $uid);
// 订单号
$orderCode = $this->get('order_code', $this->get('ordercode'));
... ...