<?php
namespace app\bsadmin\controller;
use app\bsadmin\BaseController;
use think\facade\View;
use think\facade\Session;
use think\facade\Request;
use think\facade\Db;
class Base extends BaseController
{
    protected $middleware = ['Auth'];
    /**
     * [__construct 构造函数]
     * @return [type] [description]
     */
    public function __construct(){
        parent::__construct(App());
    }
    /**
     * [outLogin 注销登录]
     * @return [type] [description]
     */
    public function outLogin()
    {
        Session::delete('AdminUser','bsadmin');
        return $this->ajaxReturn();
    }
    /**
     * [ajaxReturn 返回json]
     * @param  integer $code [description]
     * @param  [type]  $data [description]
     * @return [type]        [description]
     */
    public function ajaxReturn($msg='Success',$code=0,$data=[]){
        return json(['code'=>$code,'msg'=>$msg,'data'=>$data,'time'=>date('Y-m-d H:i:s')]);
    }
}
