<?php
namespace Admin\Controller;
use Model\AuthModel;
use Think\Controller;
use Tools\AdminController;

class IndexController extends AdminController {
    public function index()
    {
        $this->redirect('Info/index');
    }

    public function signin()
    {
        if (!IS_POST) {
            $this->display();
            return;
        }
        $name = I('post.name');
        $password = I('post.password');

        if ($name != 'classykiss' || $password != 'admin') {
            $error = '账号密码输入异常';
            $this->assign('error', $error);
            $this->display();
            return;
        }
        \SignedCookie::set_cookie('xuid', 12344321, C('COOKIE_SIGN'), 86000);
        $url = "/admin/index/index";
        redirect($url);
        return;
    }
}