Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 nuxt js + @nuxjs/auth (4.9.1) 来构建一个项目。
问题是当我使用this.$auth.strategy.token.get()访问授权令牌Cannot read property 'get' of undefined时发生错误。
this.$auth.strategy.token.get()
Cannot read property 'get' of undefined
如何访问@nuxtjs/auth 中的授权令牌?
我正在使用 nuxt.conf.js 中定义的自定义策略,如下所示:
auth: { strategies: { customStrategy: { scheme: '~/schemes/customScheme', ....
我可以使用以下路径获取令牌:
console.log(this.$auth.$storage._state['_token.customStrategy'])