Beispiel #1
0
 protected function falseHandler()
 {
     tSession::clear();
     if (isset($_SERVER["HTTP_X_REQUESTED_WITH"]) && strtolower($_SERVER["HTTP_X_REQUESTED_WITH"]) == "xmlhttprequest") {
         exit(json_encode(["success" => 0, "message" => "登陆已过期!请重新登陆后操作!"]));
     } else {
         Route::redirect("sign");
         exit;
     }
 }
Beispiel #2
0
 protected function falseHandler()
 {
     tSession::clear();
     $req = Factory::make("request");
     if (HTTP_METHOD == "GET") {
         setCookie("hl_http_referer", Route::get_currentUri(), time() + 3600, "/");
     }
     if (isset($_SERVER["HTTP_X_REQUESTED_WITH"]) && strtolower($_SERVER["HTTP_X_REQUESTED_WITH"]) == "xmlhttprequest") {
         exit(json_encode(["code" => 503, "errmsg" => "登陆已过期,请重新登陆", "go_url" => "/admin/entrance.html"]));
     } else {
         Route::redirect("sign");
         exit;
     }
 }
Beispiel #3
0
 public static function boot()
 {
     date_default_timezone_set("Asia/Shanghai");
     if (version_compare(PHP_VERSION, 5.5, "<")) {
         exit("PHP required 5.5+");
     }
     set_exception_handler(array(__CLASS__, 'panic'));
     tRedis::newInstance();
     Route::initCacheRoute();
     Config::init();
     Dependency::initCache();
     Model::initCache();
     Factory::make("session")->start();
     $self = new static();
     $self->route = Route::newInstance();
     $self->request = Request::newInstance();
     return $self;
 }
Beispiel #4
0
 public function logout()
 {
     tSession::clear();
     $goRoute = Route::getRouteUri("index");
     Route::redirect($goRoute[1]);
 }