<?php
namespace Smi\Controller;

use Think\Controller;

header("Content-Type:text/html;CharSet=UTF-8");
class IndexController extends BaseController
{
    public function index(){
        $this->display();
    }

    /**
     * 重置当前登陆用户密码
     */
    public function resetPassword()
    {
        if (IS_POST) {
            $recieve = I();
            $save['password'] = md5($recieve['password']);
            M("Admin")->where("`id` = " . $recieve['id'])->save($save);
            $this->success("重置成功", U("index"));die;
        }
        $this->assign("id", session("admin_id"));
        $this->assign("username", session("admin"));
        $this->display("resetPassword");die;
    }
}