<div class="input_box">
<div class="input_cpoy_box">验证码</div>
<input type="text" name="captcha_code" placeholder="请输入验证码" id="cap_wid">
<div class="re_captcha captcha"><img src="{$site_url}/user/customcaptcha" alt="captcha" width="100%" height="100%" /></div>
</div>
public function customCaptcha()
{
$config = [
// 验证码字体大小
'fontSize' => 25,
// 验证码位数
'length' => 4,
// 是否关闭验证码杂点
'useNoise' => false,
//是否画混淆曲线
'useCurve' => false,
];
$captcha = new \think\captcha\Captcha($config);
//echo $captcha->entry();
return $captcha->entry();
}