<?php namespace App\Controllers;
helper('util');

class SysManage extends BaseController
{
    /****************************************************
     *       日志管理页面
     /****************************************************/
     public function logManagePage(){
        $data = array();
        $username = $this->request->getGet("username");
        $token = $this->request->getGet("token");
        $page = (int)$this->request->getGet("page");
        // if($page == 0){
        //   $page = 1;
        // }
        // $perPage = (int)$this->request->getGet("perPage");
        // if($perPage == 0){
        //   $perPage = 20;
        // }

        // $item = array();
        // $item["page"] = $page;
        // $item["perPage"] = $perPage; 
        
        if($username == "" || $token == ""){
          $data["userInfo"] = [];
        }else{
          $signModel = new \App\Models\SignModel();
          $userInfo = $signModel->getItemByUsername($username);
          if($userInfo[0]["token"] == $token){
            $data["userInfo"] = $userInfo[0];
            $data["notification"] = [];       

            //TODO 小红点的逻辑需要加上               
          }else{
            $data["userInfo"] = [];
          }
        }
        $data["uri"] = getUriInfo($this->request);
		    return view('sysManage/log_manage',$data);
     }

}