Skip to content

Commit b16fb7d

Browse files
authored
Update AccountController.php
1 parent 0df0852 commit b16fb7d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/plugin/admin/app/controller/AccountController.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function index()
5858
*/
5959
public function login(Request $request): Response
6060
{
61+
$this->checkDatabaseAvailable();
6162
$captcha = $request->post('captcha');
6263
if (strtolower($captcha) !== session('captcha-login')) {
6364
return $this->json(1, '验证码错误');
@@ -247,4 +248,11 @@ protected function removeLoginLimit($username)
247248
}
248249
}
249250

251+
protected function checkDatabaseAvailable()
252+
{
253+
if (!config('plugin.admin.database')) {
254+
throw new BusinessException('请重启webman');
255+
}
256+
}
257+
250258
}

0 commit comments

Comments
 (0)