1

在我的应用程序中,我有登录和注销操作

function login()
{
    $this->layout = 'cake';

    if ($this->request->is('post')) {

        $this->Auth->login();
        if ($this->Auth->login()) {
            $this->redirect(array(
                'controller' => 'photos',
                'action' => 'flow'
            ));
        }

        else {
            $this->Session->setFlash('Nome de usuário ou senha incorreto', 'default', array(
                'class' => 'flash_fail'
            ));
        }
    }

}

但是,当用户登录时,并photos/flow没有出现用户名。我需要刷新页面(F5)以显示用户信息。有办法重定向和刷新信息吗?谢谢。

4

1 回答 1

0
if ($this->request->is('post')) {
        if ($this->Auth->login()) {
            $this->redirect(array('controller' => 'photos','action' => 'flow'));
        } else {
$this->Session->setFlash('something went wrong', 'flash', array('alert' => 'error'));
}
于 2013-10-16T12:00:48.920 回答