22 lines
443 B
PHP
22 lines
443 B
PHP
<?php
|
|
declare (strict_types = 0);
|
|
|
|
namespace app\admin\controller\v1;
|
|
|
|
use think\facade\Config;
|
|
|
|
class Captcha
|
|
{
|
|
/**
|
|
* 获取验证码
|
|
*/
|
|
public function index(\think\Config $config, \think\Session $session)
|
|
{
|
|
// 输出验证码
|
|
$captcha = new \think\captcha\Captcha($config, $session);
|
|
$data = $captcha->create();
|
|
|
|
return success('获取验证码成功!', $data["img"]);
|
|
}
|
|
}
|