清除缓冲区就应该可以了,
解决的办法是在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);
}
}
————————————————
版权声明:本文为CSDN博主「qq_34311743」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_34311743/article/details/80735044