我正在使用 nuxt js + @nuxjs/auth (4.9.1) 来构建一个项目。
问题是当我使用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'])
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句