New Google reCaptcha: How to change text “I'm not a robot”

前端 未结 6 2100
甜味超标
甜味超标 2021-02-05 08:32

I\'ve installed the latest Google reCaptcha tool on our yoga website. Now the users are confused about the text \"I\'m not a robot\" that appears next to the checkbox.

M

6条回答
  •  孤街浪徒
    2021-02-05 09:11

    I used client side captcha here is my code.its working fine for my portal.

     this.canvas = document.getElementById( 'myCanvas' ) as HTMLCanvasElement;
        var context = this.canvas.getContext( '2d' );
        context.clearRect( 0, 0, this.canvas.width, this.canvas.height );
        var alpha = [];
        alpha = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H','J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
            'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
             '2', '3', '4', '5', '6', '7', '8', '9'];
        var i;
        for ( i = 0; i < 6; i++ ) {
            var a = alpha[Math.floor( Math.random() * alpha.length )];
            var b = alpha[Math.floor( Math.random() * alpha.length )];
            var c = alpha[Math.floor( Math.random() * alpha.length )];
            var d = alpha[Math.floor( Math.random() * alpha.length )];
            var e = alpha[Math.floor( Math.random() * alpha.length )];
            var f = alpha[Math.floor( Math.random() * alpha.length )];
            var g = alpha[Math.floor( Math.random() * alpha.length )];
        }
        this.captchaCode = a + ' ' + b + ' ' + ' ' + c + ' ' + d + ' ' + e + ' ' + f + ' ' + g;
        var ctext = this.captchaCode;
        this.loginForm.controls['captcha'].setValue( this.captchaCode.replace( /\s/g, "" ) );
    

    Here is I am drawing canvas image

     /*Text to image captcha */
        var imageObj = new Image();
        imageObj.onload = function() {
            context.drawImage( imageObj, 0, 0 );
            context.font = "24px arial";
            context.fillText( ctext, 84, 32 );
        };
        imageObj.src = 'assets/modules/dummy-assets/common/img/captcha2.jpg';
    

提交回复
热议问题