FastAdmin 的 captcha 是如何來的?
如何打開 FastAdmin 的驗證嗎?
文件位置 C:\www\fastadmin\application\config.php
改 login_captcha 為 true 即可
//FastAdmin配置
'fastadmin' => [
//是否開啟前台會員中心
'usercenter' => true,
//登錄驗證碼
'login_captcha' => true,
//登錄失敗超過10則1天后重試
'login_failure_retry' => true,
//是否同一賬號同一時間只能在一個地方登錄
'login_unique' => false,
//登錄頁默認背景圖
'login_background' => "/assets/img/loginbg.jpg",
//是否啟用多級菜單導航
'multiplenav' => false,
//自動檢測更新
'checkupdate' => false,
//版本號
'version' => '1.0.0.20181031_beta',
//API接口地址
'api_url' => 'https://api.fastadmin.net',
],
分析
從這里可以看到驗證碼的 url 是 http://test.fastadmin.tk/captcha
那這個 url 是哪里定義的呢?找到 以下這個地址就可以看到。
C:\www\fastadmin\vendor\topthink\think-captcha\src\helper.php
\think\Route::get('captcha/[:id]', "\\think\\captcha\\CaptchaController@index");