public function login(){
if(!IS_POST) halt('页面不存在');
if(I('code','','strtolower')!=session('verify')){
$this->error('验证码错误');
}
$db=M('user');
$user=$db->where(array('username'=>I('username')))->find();
if(!$user||$user['password']!=I('password','','md5')){
$this->error('账号或密码错误');
}
}