Example #1
0
 static function act_login()
 {
     if (post('login_submit', 'isset')) {
         //检查验证码
         $check_code = post('code', 'post');
         if ($check_code != session('login_code', true)) {
             http::json(array('error' => 2, 'info' => 'check_code error'));
         }
         //接收数据并验证
         $account = post('account', 'account');
         $password = safe::md5(post('password', 'post'));
         self::check_admin($account, $password);
     }
     http::json(array('error' => 1, 'info' => 'login failed'));
 }