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

parent d9ae0377
...@@ -13,11 +13,13 @@ return [ ...@@ -13,11 +13,13 @@ return [
'year' => 'год', 'year' => 'год',
], ],
'colors_active_lines' => [ 'colors_active_lines' => [
/*
'shows' => '#2CA02C', 'shows' => '#2CA02C',
'clicks' => '#D62728', 'clicks' => '#D62728',
'transactions' => '#1F77B4', 'transactions' => '#1F77B4',
'salemoney' => '#FF7F0E', 'salemoney' => '#FF7F0E',
'admoney' => '#9467BD', 'admoney' => '#9467BD',
*/
'Views' => '#2CA02C', 'Views' => '#2CA02C',
'Clicks' => '#D62728', 'Clicks' => '#D62728',
'Orders' => '#1F77B4', 'Orders' => '#1F77B4',
......
...@@ -89,7 +89,6 @@ $(document).ready(function(){ ...@@ -89,7 +89,6 @@ $(document).ready(function(){
} else { } else {
for(var i = dataPeriod.length-1; i >= 0; i--) { for(var i = dataPeriod.length-1; i >= 0; i--) {
//for(var i = 0; i < dataPeriod.length; i++) { //for(var i = 0; i < dataPeriod.length; i++) {
......
...@@ -25,10 +25,11 @@ ...@@ -25,10 +25,11 @@
namespace App\Action; namespace App\Action;
use App\Authentication\UserService;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\Response\HtmlResponse; use Zend\Diactoros\Response\HtmlResponse;
use Zend\Diactoros\Response\RedirectResponse;
/** /**
* Class Index * Class Index
...@@ -46,6 +47,13 @@ class Index extends Common ...@@ -46,6 +47,13 @@ class Index extends Common
{ {
$this->initInfo($request); $this->initInfo($request);
/** @var UserService $auth */
$auth = $this->container->get(UserService::class);
if ($auth->getIdentity()) {
return new RedirectResponse($this->router->generateUri('user.cabinet'));
}
$data = [ $data = [
'lang' => $request->getAttribute('layoutInfo')->getLang(), '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