【发布时间】:2021-02-07 06:50:21
【问题描述】:
我成功从 WordPress REST API 获取数据
auth: {
strategies: {
local: {
endpoints: {
login: { url: 'http://localhost/wordpress/wp-json/jwt-auth/v1/token', method: 'post', propertyName: 'token' },
user: {url: 'http://localhost/wordpress/wp-json/wp/v2/users/me/', method: 'post', propertyName: false },
tokenRequired: true,
tokenType: 'Bearer',
globalToken: true,
}
}
},
}
但在索引页面视图中,isLogged 始终为 false。
computed: {
isLogged() {
return this.$auth.loggedIn;
}
},
在 nuxt.config.js 中目标设置为 'static'。
我不知道问题出在哪里以及如何解决。
【问题讨论】:
标签: wordpress api authentication nuxt.js