From 032767df5759eb02dcb1036e2a2e1e98d193a09a Mon Sep 17 00:00:00 2001 From: huizhang001 Date: Sat, 14 Nov 2020 00:51:12 +0800 Subject: [PATCH 1/2] =?UTF-8?q?Fix:=203.4=E7=89=88=E6=9C=AC=E5=85=BC?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/HttpController/Api/ApiBase.php | 2 +- bootstrap.php | 3 +++ composer.json | 23 +++++++++++------------ 3 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 bootstrap.php diff --git a/App/HttpController/Api/ApiBase.php b/App/HttpController/Api/ApiBase.php index adc10e2..fbe5107 100644 --- a/App/HttpController/Api/ApiBase.php +++ b/App/HttpController/Api/ApiBase.php @@ -41,7 +41,7 @@ protected function onException(\Throwable $throwable): void $msg = $throwable->getValidate()->getError()->getErrorRuleMsg(); $this->writeJson(400, null, "{$msg}"); } else { - if (Core::getInstance()->isDev()) { + if (Core::getInstance()->runMode()) { $this->writeJson(500, null, $throwable->getMessage()); } else { Trigger::getInstance()->throwable($throwable); diff --git a/bootstrap.php b/bootstrap.php new file mode 100644 index 0000000..a110977 --- /dev/null +++ b/bootstrap.php @@ -0,0 +1,3 @@ + Date: Sat, 14 Nov 2020 00:57:49 +0800 Subject: [PATCH 2/2] i[ --- App/HttpController/Api/ApiBase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/App/HttpController/Api/ApiBase.php b/App/HttpController/Api/ApiBase.php index fbe5107..915de79 100644 --- a/App/HttpController/Api/ApiBase.php +++ b/App/HttpController/Api/ApiBase.php @@ -41,7 +41,7 @@ protected function onException(\Throwable $throwable): void $msg = $throwable->getValidate()->getError()->getErrorRuleMsg(); $this->writeJson(400, null, "{$msg}"); } else { - if (Core::getInstance()->runMode()) { + if (Core::getInstance()->runMode() === 'dev') { $this->writeJson(500, null, $throwable->getMessage()); } else { Trigger::getInstance()->throwable($throwable);