2016-03-11 101 views
0

我正在使用angular-g-recaptcha,但它不在我的項目中工作,我會解釋。angular-g-recaptcha無法正常工作

我在谷歌recaptcha配置我的密鑰和域(本地主機)。

但我的recaptcha從未出現在屏幕上。

我使用提供方法來設置鍵,設置:

angular 
    .module('gitlocalApp', [ 
    'ui.router', 
    'ngResource', 
    'wo.grecaptcha' 
]) 
.config(function ($stateProvider, $urlRouterProvider,$grecaptchaProvider) { 

    $grecaptchaProvider.set({ 
    sitekey: '6LfchhoTAAAAAKdo9FfSOS90mER-PnDDmqpKPPTq', 
    theme: 'Light',          
    type: 'image',           
    size: 'NORMAL', 
     ... 
    }); 
}); 

我使用的指令這樣:

<div> 
    <div 
    grecaptcha="{sitekey: '===KEY===', theme: 'dark'}" 

    data-ng-model="response" gre-info="info"> 
    Loading... 
    </div> 
    <div data-ng-bind="respone"> </div> 
    </div> 
</div> 

回答

0

注意從Documentation

請請注意,驗證碼僅適用於從實域使用 和一個有效的重新驗證碼密鑰,所以如果你只是 加載它在你的瀏覽器這個文件不會工作。

+0

這是奇怪的,因爲谷歌的文檔會談默認情況下,所有按鍵在「localhost」(或「127.0.0.1」),所以你總是可以開發和測試您的本地MACHIN工作 –

+0

我想角沒有驗證碼[鏈接](https://github.com/CodeDistillery/angular-no-captcha),我可以在本地主機上運行 –