优化漏洞

This commit is contained in:
evoxwht 2023-05-16 11:04:46 +08:00
parent 956ab1eda1
commit a05e30a8d5

View File

@ -53,10 +53,12 @@ class LoginController
[$account, $password, $spread] = $request->postMore([
'account', 'password', 'spread'
], true);
TaskJob::dispatch('emptyYesterdayAttachment');
if (!$account || !$password) {
return app('json')->fail(410000);
}
if (count($password) > 32 || count($password) < 6) {
return app('json')->fail(400762);
}
return app('json')->success(410001, $this->services->login($account, $password, $spread));
}
@ -193,6 +195,9 @@ class LoginController
} catch (ValidateException $e) {
return app('json')->fail($e->getError());
}
if (count($password) > 32 || count($password) < 6) {
return app('json')->fail(400762);
}
$verifyCode = CacheService::get('code_' . $account);
if (!$verifyCode)
return app('json')->fail(410009);
@ -226,6 +231,9 @@ class LoginController
} catch (ValidateException $e) {
return app('json')->fail($e->getError());
}
if (count($password) > 32 || count($password) < 6) {
return app('json')->fail(400762);
}
$verifyCode = CacheService::get('code_' . $account);
if (!$verifyCode)
return app('json')->fail(410009);