In April of this year (2023), when I called the Nodejs-based NetEase Cloud API, the following error suddenly appeared: Obviously,
NetEase Cloud requires us to verify the account when calling the API. I naturally thought that it might be necessary to log in. Then, by consulting the API documentation, we can understand the operation steps required for login very easily:
At this point, we only need to add the following code to implement user login before calling the API:
$.ajax({
type: "POST",
/*注意下方的phone和password都是需要你自己提前在网易云注册的有效的账号信息*/
url: "/login/cellphone?phone=xxx&password=xxx",
/* data: "",
dataType: "dataType", */
success: function (response) {
console.log("登录成功~");
}
});
The call was successful!
code: 462 This problem does not appear after I log in. The specific reason is not clear, and I only provide a personal solution.