<?php
namespace System\Controller;
use Think\Controller;
class PublicController extends Controller {
    public function _empty(){
    $this->display('Public:404');
  }
	public function index(){
		$this->display();
	}
	public function login(){
    if(session('?s'))
      $this->redirect('Index/index');
    if(IS_POST){
      $verify = I('yzm','');  
      if(!check_verify($verify))
        $this->error("验证码错误！",'login'); 
      $account=I('account');
      $password=I('password');
      $f=M('sss')->where(array('account'=>$account))->find();
      // p($f);
      // p(md5($password));
      // die();
      if(!$f||$f['password']!=md5($password))
        $this->error('昵称不存在或密码错误','login');
      session('s',$f);
      // wlog('登录后台');
      $this->success('登陆成功！',U('Index/index'));
    }else{
      $this->display();
    }

  }
  /**
   * [verify_c description]
   * @method   verify_c
   * @Author   Amen[233713821@qq.com]
   * @DateTime 2016-05-24T09:34:50+0800
   * @return   [type]                   [description]
   */
    public function verify_c() {
      $Verify = new \Think\Verify();
      $Verify->useZh = true;
      $Verify->fontSize = 20;
      $Verify->length = 2;
      // $Verify->useImgBg = true; 
      $Verify->useNoise = false;
      $verify->fontttf = '1.ttf';
      // $Verify->codeSet = '0123456789';
      $Verify->zhSet = '们以我到他会作时要动国产的一是工就年阶义发成部民可出能方进在了不和有大这';
      $Verify->imageW = 130;
      $Verify->imageH = 50;
        //$Verify->expire = 600;  
      $Verify->entry();
    }
  }