Skip to content

Commit

Permalink
develop
Browse files Browse the repository at this point in the history
  • Loading branch information
server committed Dec 15, 2021
1 parent 004898c commit 67be7ef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion module/Vendor/Web/Controller/InstallController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
use ModStart\Admin\Auth\Admin;
use ModStart\Core\Dao\ModelUtil;
Expand Down Expand Up @@ -82,8 +83,11 @@ public function prepare()
} catch (\Exception $e) {
$msg = $e->getMessage();
if (str_contains($msg, 'Server sent charset unknown to the client')) {
return Response::generateError('数据库编码不支持');
return Response::generateError('数据库编码不支持:' . $msg);
} else if (str_contains($msg, 'Access denied for user')) {
return Response::generateError('用户密码不匹配:' . $msg);
}
Log::error('InstallError -> ' . $e->getMessage() . ' -> ' . $e->getTraceAsString());
return Response::jsonError('连接数据信息 ' . $dbHost . '.' . $dbDatabase . ' 失败!');
}

Expand Down

0 comments on commit 67be7ef

Please sign in to comment.