Authored by Rock Zhang

添加对个人中心首页是否登陆状态的判定

... ... @@ -27,7 +27,8 @@ class HomeController extends AbstractAction
// {
// // 检查用户是否登录, 未登录则跳转到登录页
// $uid = $this->getUid(true);
// if (!$uid) {
// $action = $this->getRequest()->getActionName();
// if (!$uid && $action !== 'index') {
// $this->go(Helpers::url('/signin.html'));
// }
//
... ... @@ -43,18 +44,22 @@ class HomeController extends AbstractAction
$this->setTitle('个人中心');
$this->setNavHeader('个人中心');
// $uid = $this->getUid();
$uid = 8826435;
$data = \Index\UserModel::getUserProfileData($uid);
$data += \Index\UserModel::getInfoNumData($uid);
// 优选新品数据
$channel = Helpers::getChannelByCookie();
$data['recommendForYou'] = \Index\UserModel::getPreferenceData($channel);
// print_r($data);
$data['myIndexPage'] = true;
$data['pageFooter'] = true;
$data = array(
'myIndexPage' => true,
'pageFooter' => true
);
echo $this->getRequest()->getActionName();
$uid = $this->getUid();
if ($uid) {
$data['isLogin'] = true;
$uid = 8826435;
$data += \Index\UserModel::getUserProfileData($uid);
$data += \Index\UserModel::getInfoNumData($uid);
// 优选新品数据
$channel = Helpers::getChannelByCookie();
$data['recommendForYou'] = \Index\UserModel::getPreferenceData($channel);
}
$this->_view->display('index', $data);
}
... ...