From 6a7f8897d5ff76a44895e58dd6bcc9887ccd2392 Mon Sep 17 00:00:00 2001 From: RedHood Date: Sun, 31 Jan 2021 17:23:17 +1000 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80=D0=B5=D0=B4=D1=81=D1=82?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/AuthenticationController.php | 20 +++++++++++++++++-- mirzaev/skillparts/system/models/Supply.php | 3 --- mirzaev/skillparts/system/views/account.php | 2 +- .../skillparts/system/views/profile/index.php | 4 ++-- .../system/views/profile/supplies.php | 2 +- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/mirzaev/skillparts/system/controllers/AuthenticationController.php b/mirzaev/skillparts/system/controllers/AuthenticationController.php index e0987ac..fa94f4f 100644 --- a/mirzaev/skillparts/system/controllers/AuthenticationController.php +++ b/mirzaev/skillparts/system/controllers/AuthenticationController.php @@ -2,11 +2,15 @@ namespace app\controllers; +use app\models\AccountForm; + use Yii; use yii\web\Controller; use yii\web\Response; use yii\filters\AccessControl; -use app\models\AccountForm; + +use Throwable; +use Exception; class AuthenticationController extends Controller { @@ -54,7 +58,19 @@ class AuthenticationController extends Controller // Запись ответа $return['redirect'] = '/' . $cookies['redirect']; - $return['main'] = $this->renderPartial($return['redirect'] . '/index'); + + try { + if (empty($return['main'] = $this->renderPartial($return['redirect']))) { + throw new Exception('Представление найдено, но вернуло пустой результат'); + } + } catch (Throwable $t) { + $return['main'] = $this->renderPartial($return['redirect'] . '/index'); + } + + // Генерация и запись + // $controller = 'app\\controllers\\' . ucfirst($cookies['redirect']) . 'Controller'; + // $action = 'action' . ucfirst($cookies['redirect_action']); + // $return['main'] = (new $controller())->$action(); // Очистка cookie unset(Yii::$app->response->cookies['redirect']); diff --git a/mirzaev/skillparts/system/models/Supply.php b/mirzaev/skillparts/system/models/Supply.php index 3882a26..39ddb37 100644 --- a/mirzaev/skillparts/system/models/Supply.php +++ b/mirzaev/skillparts/system/models/Supply.php @@ -6,15 +6,12 @@ namespace app\models; use Yii; -use app\models\Account; use app\models\Product; use app\models\SupplyEdgeProduct; use app\models\traits\Xml2Array; use carono\exchange1c\interfaces\ProductInterface; -use mirzaev\yii2\arangodb\Query; - /** * Поставка (выгрузка товаров от поставщиков) * diff --git a/mirzaev/skillparts/system/views/account.php b/mirzaev/skillparts/system/views/account.php index 9dcc74b..b072564 100644 --- a/mirzaev/skillparts/system/views/account.php +++ b/mirzaev/skillparts/system/views/account.php @@ -28,7 +28,7 @@ use app\models\AccountForm; $model = $model ?? new AccountForm; ?> - field($model, 'mail', ['enableLabel' => false])->textInput(['autofocus' => true, 'placeholder' => $model->getAttributeLabel('mail')]) ?> + field($model, 'mail', ['enableLabel' => false, 'options' => ['class' => 'mb-2']])->textInput(['autofocus' => true, 'placeholder' => $model->getAttributeLabel('mail')]) ?> field($model, 'pswd', ['enableLabel' => false])->passwordInput(['placeholder' => $model->getAttributeLabel('pswd')]) ?>
diff --git a/mirzaev/skillparts/system/views/profile/index.php b/mirzaev/skillparts/system/views/profile/index.php index ebfddc5..96ac545 100644 --- a/mirzaev/skillparts/system/views/profile/index.php +++ b/mirzaev/skillparts/system/views/profile/index.php @@ -1,16 +1,16 @@
diff --git a/mirzaev/skillparts/system/views/profile/supplies.php b/mirzaev/skillparts/system/views/profile/supplies.php index 497acb5..d254f52 100644 --- a/mirzaev/skillparts/system/views/profile/supplies.php +++ b/mirzaev/skillparts/system/views/profile/supplies.php @@ -13,7 +13,7 @@ use app\models\Supply;