|
@@ -25,6 +25,13 @@ class AuthController extends BaseAuthController
|
|
{
|
|
{
|
|
|
|
|
|
$credentials = $request->only([$this->username(), 'password', 'captcha']);
|
|
$credentials = $request->only([$this->username(), 'password', 'captcha']);
|
|
|
|
+ //去除前后空格
|
|
|
|
+ foreach (['username', 'password', 'captcha'] as $key) {
|
|
|
|
+ if (isset($credentials[$key])) {
|
|
|
|
+ $credentials[$key] = trim($credentials[$key]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
$remember = (bool)$request->input('remember', false);
|
|
$remember = (bool)$request->input('remember', false);
|
|
|
|
|
|
/** @var \Illuminate\Validation\Validator $validator */
|
|
/** @var \Illuminate\Validation\Validator $validator */
|
|
@@ -35,7 +42,7 @@ class AuthController extends BaseAuthController
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
|
|
- if ($request->input('captcha') != Session::get('captcha'))
|
|
|
|
|
|
+ if (trim($request->input('captcha')) != Session::get('captcha'))
|
|
{
|
|
{
|
|
$session_captcha = Session::get('captcha');
|
|
$session_captcha = Session::get('captcha');
|
|
|
|
|