Skip to content

Latest commit

 

History

History
60 lines (39 loc) · 1.18 KB

index.markdown

File metadata and controls

60 lines (39 loc) · 1.18 KB
title description keys
图形验证码(captcha-business)
提供生成图形验证码接口,文档。
captcha,captcha-business,phpzlc/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