array( 'class'=>'CCaptchaAction', 'backColor'=>0xFFFFFF, ), // page action renders "static" pages stored under 'protected/views/site/pages' // They can be accessed via: index.php?r=site/page&view=FileName 'page'=>array( 'class'=>'CViewAction', ), ); } /** * This is the action to handle external exceptions. */ public function actionError() { Helper::error('系统错误', 500, Yii::app()->errorHandler->error); } /** * Displays the login page */ public function actionLogin() { $model=new LoginForm; if (isset($_POST['username'])) { $model->attributes=$_POST; if($model->validate() && $model->login()){ Helper::ok(['token' => \Yii::app()->session->getSessionID(), 'refreshToken' => '']); } else { Helper::error('登入失败'); } } Helper::error('参数错误'); } /** * Logs out the current user and redirect to homepage. */ public function actionLogout() { Yii::app()->user->logout(); Helper::ok(); } }