我从 cakephp 框架开始,我使用 auth 创建登录表单,在我的 appcontroller 中添加:
class AppController extends Controller {
public $components = array('Auth', 'Cookie');
public function beforeFilter(){
$this->Auth->authenticate = array(
'Form' => array(
'userModel' => 'User',
'fields' => array('name' => 'name', 'password' => 'password'),
)
);
$this->Auth->loginAction = array('controller' => 'TestOnlineSystem', 'action' => 'P001');
$this->Auth->loginRedirect = array('controller' => 'TestOnlineSystem', 'action' => 'index');
$this->Auth->loginError = 'Failed to login';
$this->Auth->authError = ' ';
}
}
但是当我运行 TestOnlineSystem/P001 时,它会自动重定向到用户/登录 anh 显示消息网络控制器用户控制器。我该如何解决它,P001 是我的登录页面