Foal Ts和Nuxt js

时间:2020-03-26 02:13:56

标签: typescript rest api axios nuxt.js

我在后端使用“ foal ts”,并且正确设置了端点,因此我可以在前端进行身份验证并获取“ Nuxt js”应用程序的令牌 我用邮递员测试了它,一切都很完美 我的“ nuxtJS”应用程序也可以正确验证 但是,当我尝试像在邮递员中那样获取/ api / note时,我收到了错误的请求,

enter image description here

enter image description here //在nuxt组件安装方法中:

this.$axios.get('/api/notes',{data:{email:'admin@gmail.com'}})
.then(res => {return res.data})
.catch(err => {return err.message})  

怎么了??? !!!! 后端的一些屏幕截图=== >>>

enter image description here

1 个答案:

答案 0 :(得分:0)

我通常无法通过get请求发送正文,而必须将它们作为查询参数发送。