input('email'))->first(); $redisKey = 'sendEmailVerify:' . $request->input('email'); if (Redis::get($redisKey) !== $request->input('email_code')) { abort(500, '邮箱验证码有误'); } $user->password = password_hash($request->input('password'), PASSWORD_DEFAULT); if (!$user->save()) { abort(500, '重置失败'); } Redis::del($redisKey); return response([ 'data' => true ]); } }