Cml\Vendor\VerifyCode::checkCode PHP Method

checkCode() public static method

校验验证码
public static checkCode ( string $input, boolean $isCn = false, string $verifyName = 'verifyCode' ) : boolean
$input string 用户输入
$isCn boolean 是否为中文验证码
$verifyName string 生成验证码时的字段
return boolean 正确返回true,错误返回false
    public static function checkCode($input, $isCn = false, $verifyName = 'verifyCode')
    {
        $key = Cookie::get($verifyName);
        if (!$key) {
            return false;
        }
        $code = Model::getInstance()->cache()->get($key);
        Model::getInstance()->cache()->delete($key);
        $isCn && ($input = md5(urldecode($input)));
        if ($code === false || $code != $input) {
            return false;
        } else {
            return true;
        }
    }