后置中间件拦截登录导致captcha验证码显示不了;
Auth中间件
<?php
namespace app\admin\middleware;
class Auth
{
public function handle($request, \Closure $next)
{
$Response = $next($request);
if (empty(session(config("admin.Session_admin"))) && !preg_match('/login/i', $request->pathinfo())) {
return redirect(url('login/index'));
}
return $Response;
}
}
前台验证码
<div class="admin-captcha"><img src="{:url('verify/index')}" alt="" width="120" height="49"
onclick='this.src="/admin/Verify/index.html?"+Math.random();'></div>
验证码控制器
<?php
namespace app\admin\controller;
use app\BaseController;
use think\captcha\facade\Captcha;
class verify extends BaseController
{
public function index()
{
return Captcha::create('verify');
}
}
有没有大拿指点一下如何处理