如何在nuxt / apollo中传递动态令牌?

时间:2019-06-12 18:13:13

标签: graphql apollo nuxt vue-apollo

我想使用@ nuxt / apollo将动态的令牌传递给HTTP请求的标头

我已经尝试过:

//./ nuxt.config.js 阿波罗:{

includeNodeModules: true,
clientConfigs: {
     default: {
     httpEndpoint: 'http://localhost:8000/graph/',
    },
    interno: {
      httpEndpoint: 'http://localhost:8000/graphiql/',
      httpLinkOptions: {
        headers:{
            Authorization: 'JWT token_static',
        }
      }
    },
  }
},

它可以工作,但是我需要我的令牌是动态的。

0 个答案:

没有答案