我有一个api使用jwt的authencation.我正在使用这个api的vuejs应用程序.我正在尝试使用应用程序在应用程序中显示图像
<img src="my/api/link" />
Run Code Online (Sandbox Code Playgroud)
但是api期望Authorization标题jwt token在里面.
我可以像这样在浏览器请求中添加标题(这里几个问题的回答让我相信它不可能)?
有没有办法(使用js)或我应该改变api自己?
我使用 nuxt.js /express 启动该项目。
我们为 nuxt.js 中的每个组件 (.vue) 开发了样式。因此,在路由时,属性会叠加在同一个类名(样式)上,从而导致页面无法正常显示。
1.“样式范围”的正确用法是什么?
2. 或者路由过程应该是<a>而不是<nuxt-link>?
我在我的 Vue.js 项目之一中使用 axios。无论 API 调用失败还是完成,我都在执行一些操作。我开始了解finnaly()方法。它在 API 请求失败或成功后执行。但是我没有在最终给出的回调中得到响应对象。
例如:
axios()
.then((response) => {
console.log(response); // response object defined
//handle response on success
return response
}).finally((response) => {
console.log(response); // response object undefined
});
Run Code Online (Sandbox Code Playgroud)