Files
orico-official-website/app/admin/controller/v1/Captcha.php
2024-12-31 18:05:45 +08:00

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"]);
}
}