具體代碼如下:
受保護的功能
Check_verify($code) //驗證函數
{
$verify = new
\ Think \ Verify();
return $ verify-& gt;check($ code);
}
公共函數login(){ // login
$ authcode = trim(I(' authcode ');
//在前端從ajax獲取authcode。
如果(
!$ this-& gt;check_verify($authcode)) ){
$ this-& gt;AjaxReturn(0,“驗證碼錯誤”,0);
}