Commit 698c7fa3 by Triyah Fatmawati

Fix Captcha

parent 50750dcf
...@@ -219,6 +219,6 @@ class LoginController extends Controller ...@@ -219,6 +219,6 @@ class LoginController extends Controller
} }
public function reloadCaptcha() public function reloadCaptcha()
{ {
return response()->json('captcha', captcha_img()); return response()->json(['captcha'=> captcha_img()]);
} }
} }
...@@ -96,8 +96,8 @@ ...@@ -96,8 +96,8 @@
@push('scripts') @push('scripts')
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$('.reload').click(function () { $(document).ready(function(){
console.log('tes'); $('#reload').click(function(){
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: 'reload-captcha', url: 'reload-captcha',
...@@ -105,6 +105,7 @@ ...@@ -105,6 +105,7 @@
$(".captcha span").html(data.captcha); $(".captcha span").html(data.captcha);
} }
}); });
}); })
})
</script> </script>
@endpush @endpush
\ No newline at end of file
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<!-- Styles --> <!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet"> <link href="{{ asset('css/app.css') }}" rel="stylesheet">
@stack('scripts')
</head> </head>
<body> <body>
<div id="app"> <div id="app">
...@@ -76,6 +77,5 @@ ...@@ -76,6 +77,5 @@
@yield('content') @yield('content')
</main> </main>
</div> </div>
@stack('scripts')
</body> </body>
</html> </html>
...@@ -15,7 +15,7 @@ Auth::routes(['register' => false]); ...@@ -15,7 +15,7 @@ Auth::routes(['register' => false]);
// use Illuminate\Routing\Route; // use Illuminate\Routing\Route;
Route::get('reload-captcha', 'Auth\LoginController@reloadCaptcha')->name('reload-captcha'); Route::get('reload-captcha', 'Auth\LoginController@reloadCaptcha')->name('reload-captch');
// Route::get('login','Auth\LoginController@showLoginForm')->name('login'); // Route::get('login','Auth\LoginController@showLoginForm')->name('login');
// Route::post('login','Auth\LoginController@login'); // Route::post('login','Auth\LoginController@login');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment