//表单页面
<center> <form action="?r=user/login_pro" method="post"> <table> <input type="hidden" id="_csrf" name="_csrf" value="<?php echo yii::$app->request->csrfToken?>"/> <tr> <td>用户名:</td> <td><input type="text" name="name"/></td> </tr> <tr> <td>密码:</td> <td><input type="password" name="pwd"/></td> </tr> <tr> <td><input type="submit"/></td> <td></td> </tr> </table> </form> </center>//前台控制器
//接值,调用接口 public function