Редирект на стр. кабинета с главной для авторизированного юзера

parent d9ae0377
......@@ -13,11 +13,13 @@ return [
'year' => 'год',
],
'colors_active_lines' => [
/*
'shows' => '#2CA02C',
'clicks' => '#D62728',
'transactions' => '#1F77B4',
'salemoney' => '#FF7F0E',
'admoney' => '#9467BD',
*/
'Views' => '#2CA02C',
'Clicks' => '#D62728',
'Orders' => '#1F77B4',
......
......@@ -89,7 +89,6 @@ $(document).ready(function(){
} else {
for(var i = dataPeriod.length-1; i >= 0; i--) {
//for(var i = 0; i < dataPeriod.length; i++) {
......
......@@ -25,10 +25,11 @@
namespace App\Action;
use App\Authentication\UserService;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\Response\HtmlResponse;
use Zend\Diactoros\Response\RedirectResponse;
/**
* Class Index
......@@ -45,7 +46,14 @@ class Index extends Common
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next = null)
{
$this->initInfo($request);
/** @var UserService $auth */
$auth = $this->container->get(UserService::class);
if ($auth->getIdentity()) {
return new RedirectResponse($this->router->generateUri('user.cabinet'));
}
$data = [
'lang' => $request->getAttribute('layoutInfo')->getLang(),
];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment