Showing
2 changed files
with
8 additions
and
2 deletions
@@ -607,10 +607,12 @@ class AbstractAction extends Controller_Abstract | @@ -607,10 +607,12 @@ class AbstractAction extends Controller_Abstract | ||
607 | /** | 607 | /** |
608 | * 判断是不是APP | 608 | * 判断是不是APP |
609 | * | 609 | * |
610 | - * @return bool | 610 | + * @return bool false:不是app,true:是app |
611 | */ | 611 | */ |
612 | public function isApp(){ | 612 | public function isApp(){ |
613 | - $appVersion = $this->get('app_version'); | 613 | + $appVersion = $this->get('app_version', false); |
614 | + //为空,从缓存中获取 | ||
615 | + $appVersion = empty($appVersion) ? $this->getSession('app_version') : $appVersion; | ||
614 | return !empty($appVersion); | 616 | return !empty($appVersion); |
615 | } | 617 | } |
616 | 618 |
@@ -34,6 +34,10 @@ class IndexController extends AbstractAction | @@ -34,6 +34,10 @@ class IndexController extends AbstractAction | ||
34 | } else { | 34 | } else { |
35 | $gender = Helpers::getGenderByCookie(); | 35 | $gender = Helpers::getGenderByCookie(); |
36 | } | 36 | } |
37 | + | ||
38 | + //首次进来,保存app_version参数,当前会话,其它页面会用到 | ||
39 | + $this->setSession('app_version', $this->get('app_version', false)); | ||
40 | + | ||
37 | // // 设置侧边栏逛的默认选中状态 | 41 | // // 设置侧边栏逛的默认选中状态 |
38 | // if ($gender === '1,3') { | 42 | // if ($gender === '1,3') { |
39 | // $this->setNavSide('boys'); | 43 | // $this->setNavSide('boys'); |
-
Please register or login to post a comment