We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在页面上点击按钮,就会提示 添加失败:AxiosError: Request failed with status code 403 我把请求直接复制出来在postman里试了试,发现header有个Origin:http://localhost:8081,去了就能调用成功了.
Origin:http://localhost:8081
F12的curl
curl 'http://localhost:8080/ankiconnect' \ -H 'Accept: application/json, text/plain, */*' \ -H 'Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6' \ -H 'Connection: keep-alive' \ -H 'Content-Type: application/json' \ -H 'Origin: http://localhost:8080' \ -H 'Referer: http://localhost:8080/dict' \ -H 'Sec-Fetch-Dest: empty' \ -H 'Sec-Fetch-Mode: cors' \ -H 'Sec-Fetch-Site: same-origin' \ -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0' \ -H 'sec-ch-ua: "Microsoft Edge";v="123", "Not:A-Brand";v="8", "Chromium";v="123", "Microsoft Edge WebView2";v="123"' \ -H 'sec-ch-ua-mobile: ?0' \ -H 'sec-ch-ua-platform: "Windows"' \ --data-raw '{"action":"addNote","version":6,"params":{"note":{"deckName":"test","modelName":"ja-learner","fields":{"单词":"差し引く | さしひく ③","例句":"扣","解释":"<li><b>扣除,减去</b>(ある数量から他の数量を引きさる。さっぴく。)</li>"},"options":{"allowDuplicate":false,"duplicateScope":"deck","duplicateScopeOptions":{"checkChildren":false,"checkAllModels":false}}}}}'
anki connect 配置文件
{ "apiKey": null, "apiLogPath": null, "ignoreOriginList": [], "webBindAddress": "127.0.0.1", "webBindPort": 8765, "webCorsOriginList": [ "http://localhost" ] }
appsettings.json
"Anki": { "AnkiConnectUrl": "http://127.0.0.1:8765", "Deck": "test", "Model": "ja-learner", "FieldNames":{ "Word": "单词", "Example": "例句", "Explain": "解释" } }
大佬方便让我看一下你的配置吗
The text was updated successfully, but these errors were encountered:
感谢反馈!我看了下我的配置,唯一的区别是
"webCorsOriginList": [ "*" ]
你改一下试试?
Sorry, something went wrong.
感谢反馈!我看了下我的配置,唯一的区别是 "webCorsOriginList": [ "*" ] 你改一下试试?
非常感谢!解决了
No branches or pull requests
在页面上点击按钮,就会提示 添加失败:AxiosError: Request failed with status code 403
我把请求直接复制出来在postman里试了试,发现header有个
Origin:http://localhost:8081
,去了就能调用成功了.F12的curl
anki connect 配置文件
appsettings.json
大佬方便让我看一下你的配置吗
The text was updated successfully, but these errors were encountered: