ajcaptcha.php 2.6 KB

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