thinkphp5 按照手册上操作后 验证码不显示

清除缓冲区就应该可以了,
解决的办法是在vendor/topthink/think-captcha/CaptchaController.php中加上这个ob_clean();就可以了,

修改后的代码如下:
class CaptchaController
{
public function index($id = "")
{
ob_clean(); //清除缓存 自己添加
$captcha = new Captcha((array)Config::get('captcha'));
return $captcha->entry($id);
}
}

猜你喜欢

转载自blog.csdn.net/qq_34311743/article/details/80735044