Skip to content
New issue

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

fix: 有道云api失效问题 #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

liuarui
Copy link

@liuarui liuarui commented Jul 20, 2023

  1. 修复有道云失效
  2. 添加环境变量方式

@lowking
Copy link

lowking commented Aug 23, 2023

依然不行,请求参数:

{
    "query":
    {
        "q": "c",
        "from": "zh-CHS",
        "to": "en",
        "appKey": "14c480aa0dxxxxxx",
        "salt": 1692783427503,
        "sign": "af858eebfa6f6077a955bd1a54a16dc8a481fbeb95300f9eb85b97ce66c459da",
        "signType": "v3",
        "curtime": 1692783428
    }
}

返回结果:

{
  "requestId": "b973b6f3-1e8c-4e15-a1e8-a4236737452e",
  "errorCode": "101",
  "l": "null2null"
}

101,文档里面意思是参数不全,但是看了api必填就上面8个参数,不知道哪里问题了
有没有可能请求的方式问题,导致有道接收不到参数呢

@lowking
Copy link

lowking commented Sep 19, 2023

今天看了下alfy源码,我把请求体的query改成body就可以了,不知道为撒用query发送get不行,用body发送post就可以。有道官网写着method,get/post都可以。这是设置body之后,afly使用got构建post请求的逻辑:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants