ajcaptcha.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. declare(strict_types=1);
  3. return [
  4. 'font_file' => '', //自定义字体包路径, 不填使用默认值
  5. //文字验证码
  6. 'click_world' => [
  7. 'backgrounds' => []
  8. ],
  9. //滑动验证码
  10. 'block_puzzle' => [
  11. /*背景图片路径, 不填使用默认值, 支持string与array两种数据结构。string为默认图片的目录,array索引数组则为具体图片的地址*/
  12. 'backgrounds' => public_path() . 'static/images/captcha/',
  13. /*模板图,格式同上支持string与array*/
  14. 'templates' => [],
  15. 'offset' => 10, //容错偏移量
  16. 'is_cache_pixel' => true, //是否开启缓存图片像素值,开启后能提升服务端响应性能(但要注意更换图片时,需要清除缓存)
  17. 'is_interfere' => true, //开启干扰图
  18. ],
  19. //水印
  20. 'watermark' => [
  21. 'fontsize' => 12,
  22. 'color' => '#000000',
  23. 'text' => ''
  24. ],
  25. 'cache' => [
  26. //若您使用了框架,并且想使用类似于redis这样的缓存驱动,则应换成框架的中的缓存驱动
  27. 'constructor' => app()->make(\think\Cache::class),
  28. 'method' => [
  29. //遵守PSR-16规范不需要设置此项(tp6, laravel,hyperf)。如tp5就不支持(tp5缓存方法是rm,所以要配置为"delete" => "rm")
  30. /**
  31. * 'get' => 'get', //获取
  32. * 'set' => 'set', //设置
  33. * 'delete' => 'delete',//删除
  34. * 'has' => 'has' //key是否存在
  35. */
  36. ],
  37. 'options' => [
  38. //如果您依然使用\Fastknife\Utils\CacheUtils做为您的缓存驱动,那么您可以自定义缓存配置。
  39. 'expire' => 300,//缓存有效期 (默认为0 表示永久缓存)
  40. 'prefix' => '', //缓存前缀
  41. 'path' => '', //缓存目录
  42. 'serialize' => [], //缓存序列化和反序列化方法
  43. ]
  44. ]
  45. ];