0
http://localhost:9000/api/res.users?sudo=1&filter=[["id","=",11]]&query={id,name,image_128,phone}

如何用 axios 编写上面的 url 并将其发送到服务器。

我尝试了参数,但我认为我错过了一些东西,因为我得到了

     Promise {
  "_U": 0,
  "_V": 0,
  "_W": null,
  "_X": null,
}

我的代码看起来像这样这是我尝试使用 apisauce 的时候

现在使用 axios 我尝试过这种方式

const res = axios.get('http://localhost:9000/api/res.users', {
        params:{
            sudo: '1',
            filter: '[["id", "=", 11]]',
            query: "{phone,name}"
        }
    });
    console.log("res", res);
4

1 回答 1

0

试试这个它会工作

axios.get('http://localhost:9000/api/res.users', {
    params:{
        sudo: '1',
        filter: '[["id", "=", 11]]',
        query: "{phone,name}"
    }
}).then(res=>{
   console.log("res", res);
});
于 2022-01-25T10:02:31.030 回答