NuxtJS / Apollo如何设置自定义标题

时间:2018-11-13 13:58:06

标签: vuejs2 nuxt.js vue-apollo

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

    import csv

    try:
       import xml.etree.cElementTree as ET
       print("running with xml.etree", "\n")
    except ImportError:
       print("xml didn't import", "\n")


    path_0 = "C:/folder1/" 

    root = ET.Element("users")

    index = 0


    while index < 8:

       index = index + 1 

       with open(path_0+"_"+str(index)+".csv") as myfile:
           csvrows = csv.reader(myfile, delimiter=',')
           for row in csvrows:

             doc = ET.SubElement(root, "user")

             ET.SubElement(doc, "thing").text = "thing"

             tree = ET.ElementTree(root)

             tree.write(path_0+"output_file"+str(index)+".xml")

我有这样的东西

on my nuxt.config.js

谢谢

1 个答案:

答案 0 :(得分:0)

赞:

nuxt.conifg.js

apollo: {
  clientConfigs: {
    default: {
      httpEndpoint: 'localhost:4000',
      httpLinkOptions: {
        headers: {
           'x-token': 'hash',
           'x-auth-token': 'hash',
           'x-refresh-token':  'hash'
        }
      }
    }
  }
},
相关问题