2

如何在@nuxtjs/apollo 上设置自定义标题?

on my nuxt.config.js

我有这样的东西

apollo: {
  "x-token": "hash",
  "x-auth-token": "hash",
  "x-refresh-token":  "hash",
  headers: {
  },
  clientConfigs: {
    default: {
      // required
      httpEndpoint: "localhost:4000"
    }
  }
}

谢谢

4

1 回答 1

0

像这样:

nuxt.conifg.js

apollo: {
  clientConfigs: {
    default: {
      httpEndpoint: 'localhost:4000',
      httpLinkOptions: {
        headers: {
           'x-token': 'hash',
           'x-auth-token': 'hash',
           'x-refresh-token':  'hash'
        }
      }
    }
  }
},
于 2018-11-13T14:11:44.170 回答