PHPZlc & Symfony PHPZlc & Symfony
  • 首页 
  • 文档 
  • 博客 
  • 联系我们 
  • 登录 注册
PHPZlc & Symfony PHPZlc & Symfony
登录 注册
PHPZlc & Symfony
  • 首页 
  • 文档 
  • 博客 
  • 联系我们 
  • CaptchaBusiness
loading
  1. 首页
  2. 文档
  3. 业务组件
  4. CaptchaBusiness
更新于 2022-05-19 16:28:16
  • CaptchaBusiness

图形验证码(captcha-business)

编辑

业务介绍

提供生成图形验证码接口,文档。

源码地址

phpzlc/captcha-business

安装

composer require phpzlc/captcha-business

项目中引用

在项目根路由中config/routes.yaml引入

captcha:
  resource: "routing/captcha/captcha.yaml"
  prefix:   /captcha

提供功能

  1. 验证码生成接口

    # 验证码生成
    captcha_generate:
      path: /generate
      controller: App\Controller\Captcha\CaptchaController:generate
    

    如果使用,可以生成查看API文档。文档知识

  2. 验证图像码

    use App\Business\CaptchaBusiness\CaptchaBusiness;
    
    $captcha = new CaptchaBusiness($this->container);
    
    if (!$captcha->isCaptcha('admin_auth_login', $request->get('imgCode'))) {
        return Responses::error(Errors::getError());
    }
    

底层技术

gregwar/captcha

支持
Symfony 5.4
CONTENTS
Links
gitee github composer
视频教程
Leaf Illustration

皖ICP备17026196号-3 34020302000197号

© All Rights Reserved by PHPZlc