问题标签 [microblogging]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
105 浏览

javascript - 使用 vue.js 的 axios 标头授权

我正在尝试将标头令牌与 axios 一起使用。但是,我收到一个 CORS 错误,因为我显然没有正确传递令牌(移动到未经授权的提要有效)

这是我的 http-common.js 文件

这是我的 Timeline.vue 组件

URL 正确,但令牌失败(我相信) POST /account/verify — 接受应用令牌(我已设置)并返回身份验证令牌和其他详细信息。

这是 API 文档,有点稀疏但

http://help.micro.blog/2017/api-json/

http://help.micro.blog/2018/api-authentication/

我相信这是显而易见的,非常感谢任何帮助。