【发布时间】:2021-10-18 00:29:30
【问题描述】:
我正在使用 nuxt js + @nuxjs/auth (4.9.1) 来构建一个项目。
问题是当我使用this.$auth.strategy.token.get() 访问授权令牌时出现错误Cannot read property 'get' of undefined。
如何在@nuxtjs/auth 中访问授权令牌?
【问题讨论】:
-
你使用哪种策略?
-
我只使用了一种策略。
local -
试试 this.$auth['local'].token.get() 坚果我不知道。注销 this.$auth 并查找您需要的内容
-
返回错误:
Cannot read property 'token' of undefined