【问题标题】:Implement BotDetect With Angular js使用 Angular js 实现 BotDetect
【发布时间】:2017-10-15 15:12:10
【问题描述】:

我们拥有BotDetect 的许可证。我想用 Angular js 实现这个 BotDetect。我在 google 中搜索并没有发现任何有用的信息,但是,我得到了 angularjs-captcha,这看起来很有希望,但对我没有帮助。

这正是我需要的。

  1. 使用验证码图片加载页面
  2. 用户填写表格
  3. 提交时用户点击
  4. 使用$http请求页面提交
  5. 如果响应成功或失败,则应根据其工作引擎重新加载验证码。

这是我的表格

<form ng-submit="Submit($event)">
    <table width="100%" cellpadding="0" cellspacing="1" align="center">
        <tr>
            <td class="datafield">
                <label>Name:</label>
                <span class="red">*</span>
            </td>
            <td class="datafield">
                <input type="text" maxlength="50" class="searchboxmain" placeholder="enter name..."
                    ng-model="Form.Name" />
            </td>
        </tr>
        <tr>
            <td class="datafield">
                <label>Email:</label>
                <span class="red">*</span>
            </td>
            <td class="datafield">
                <input type="email" maxlength="240" class="searchboxmain" placeholder="enter email..."
                    ng-model="Form.Email" />
            </td>
        </tr>
        <tr>
            <td class="datafield">Enter Captcha
            </td>
            <td class="datafield">
                <botdetect-captcha>
            <br />
                <input type="text" id="CaptchaCodeTextBox" ng-model="Form.Captcha"/>
            </td>
        </tr>
        <tr>
            <td class="datafield"></td>
            <td class="datafield">
                <button class="submitbutton" ng-click="Submit($event)">Submit enquiry</button>
            </td>
        </tr>
    </table>
</form>

控制器

app.controller('ContactCtrl', function($scope, $http) {
    $scope.Form = {
        Name: '',
        Email: '',
        Captcha: ''
    };
    $scope.Submit = function(event) {
        // Here all code
        event.preventDefault();
    };
});

我很确定可以有其他解决方案而不是使用这个 Angular Captcha,但我不认识任何人,可以接受替代解决方案。

【问题讨论】:

  • 它可能提供了一些 jQuery 函数来重新加载我不知道的验证码图像,使用我可以处理其余工作的唯一 jQuery 解决方案。
  • 你是用JAVA的吗? Docs 说目前只支持 Java (captcha.com/angular-captcha.html#angularjs)
  • 不,我使用的是 ASP.NET C#(不是 MVC)。
  • 来自captcha website:“请注意:目前,AngularJS 模块仅支持 BotDetect Java,但即将支持 PHP 和 ASP.NET 版本。”我个人从未使用过 ASP.NET,但可以创建一种解决方法,将验证码托管在运行 MVC 的单独页面上。如果这对你们来说不是一个选择,那么看起来你现在不走运:(
  • 这可能会有所帮助:hanselman.com/blog/…

标签: jquery angularjs captcha botdetect


【解决方案1】:

根据Bot Detect

请注意:目前,AngularJS 模块仅支持 BotDetect Java,但即将支持 PHP 和 ASP.NET 版本。

但是,您应该能够通过以下指南完成您在问题中描述的内容:Integrating ASP.NET MVC 3 into existing upgraded ASP.NET 4 Web Forms applications

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-01-28
    • 1970-01-01
    • 1970-01-01
    • 2014-07-15
    • 1970-01-01
    • 2019-01-07
    • 1970-01-01
    相关资源
    最近更新 更多