pos-gis/app/Services/AuthService.php

57 lines
1.0 KiB
PHP
Raw Permalink Normal View History

2024-10-07 06:13:42 +00:00
<?php
namespace App\Services;
use App\Interfaces\AuthApps;
class AuthService implements AuthApps
{
public function check()
{
return \Session::has("AppsToken");
}
public function add($token)
{
\Session::forget("AppsToken");
\Session::put("AppsToken", $token);
}
public function clear()
{
\Session::forget("AppsToken");
\Session::flush();
}
public function addMsg($message)
{
\Session::put("AppsMsgInfo", $message);
}
public function clearMsg()
{
\Session::forget("AppsMsgInfo");
}
public function callMsg()
{
$msgInfo = \Session::get("AppsMsgInfo");
// if ($msgInfo == null)
if ($msgInfo != null){
$list['message'] = $msgInfo;
$this->clearMsg();
return view("components.alerts.alertError", $list)->render();
}else{
return "";
}
}
public function token()
{
return \Session::get("AppsToken");
}
}