laravel 前后端分离验证码

https://segmentfault.com/a/1190000016764250?utm_source=tag-newest

https://blog.csdn.net/qq78442761/article/details/125796778

class CaptchaController extends Controller
{
    public function captcha()
    {
        $captcha = app('captcha')->create('default', true);
        return $this->success($captcha);
    }
}

  

 if (!captcha_api_check($request->captcha, $request->key)){
            return $this->error("验证码不匹配");
        }

  

posted @ 2023-06-20 10:15  星云惊蛰  阅读(25)  评论(0)    收藏  举报