0

我使用带有角度前端和弹簧后端的角度验证码。

我做了这里定义的所有步骤,但是当我打电话时

my-api-endpoint/simple-captcha-endpoint?get=html&c=yourFirstCaptchaStylews

它给了我以下错误

{ "timestamp": "2021-02-08T00:37:14.011+0000", "status": 400, "error": "Bad Request", "message": "请求的 captchaStyle 'yourFirstCaptchaStyle' 没有在botdetect.xml!", "path": "//simple-captcha-endpoint" }

这是我的 botdetect.xml 文件内容:

<?xml version="1.0" encoding="UTF-8"?>
<botdetect xmlns="https://captcha.com/schema/java"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="https://captcha.com/schema/java
             https://captcha.com/schema/java/botdetect-4.0.beta3.7.xsd">

    <captchaStyles>
        <captchaStyle>
            <name>yourFirstCaptchaStyle</name>
            <userInputID>yourFirstCaptchaUserInput</userInputID>
        </captchaStyle>
    </captchaStyles>
</botdetect>

我不知道为什么在 https 域上工作时出现此错误,但在 http://localhost 上却没有

我错过了什么 ?提前致谢

4

1 回答 1

0
"BDC_configFileLocation", "/WEB-INF/classes/botdetect.xml");

这条路/WEB-INF/classes/botdetect.xml对我有用

于 2021-02-10T23:53:26.330 回答