From f225ef8bd1269272ef5b13937357344f16362bf6 Mon Sep 17 00:00:00 2001 From: Brandon Fergerson Date: Tue, 19 Apr 2022 12:06:05 +0200 Subject: [PATCH] use demo server --- src/graphql/fetch.ts | 7 ++++++- src/graphql/index.ts | 7 ++++++- vue.config.js | 4 +++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/graphql/fetch.ts b/src/graphql/fetch.ts index 4521b43d..4f094340 100644 --- a/src/graphql/fetch.ts +++ b/src/graphql/fetch.ts @@ -24,7 +24,12 @@ async function query(param: { const res: AxiosResponse = await axios.post( "/graphql", { query: param.queryStr, variables: { ...param.conditions } }, - { cancelToken: cancelToken() } + { + cancelToken: cancelToken(), + headers: { + Authorization: "Basic c2t5d2Fsa2luZzpza3l3YWxraW5n", + }, + } ); if (res.data.errors) { res.data.errors = res.data.errors diff --git a/src/graphql/index.ts b/src/graphql/index.ts index ab6fd319..b04cd06f 100644 --- a/src/graphql/index.ts +++ b/src/graphql/index.ts @@ -51,7 +51,12 @@ class Graphql { query: query[this.queryData], variables: variablesData, }, - { cancelToken: cancelToken() } + { + cancelToken: cancelToken(), + headers: { + Authorization: "Basic c2t5d2Fsa2luZzpza3l3YWxraW5n", + }, + } ) .then((res: AxiosResponse) => { if (res.data.errors) { diff --git a/vue.config.js b/vue.config.js index dd9d016c..0f494b02 100644 --- a/vue.config.js +++ b/vue.config.js @@ -25,7 +25,9 @@ module.exports = { devServer: { proxy: { "/graphql": { - target: `${process.env.SW_PROXY_TARGET || "http://127.0.0.1:12800"}`, + target: `${ + process.env.SW_PROXY_TARGET || "http://demo.skywalking.apache.org" + }`, changeOrigin: true, }, },