When calling the Nodejs version of NetEase Cloud API, encounter code: -462 error solution

In April of this year (2023), when I called the Nodejs-based NetEase Cloud API, the following error suddenly appeared: Obviously,
insert image description here
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:
insert image description here
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!
insert image description here
code: 462 This problem does not appear after I log in. The specific reason is not clear, and I only provide a personal solution.

Guess you like

Origin blog.csdn.net/NEXT00/article/details/130212610