From 393fc1cc71e3c5087e8ae7c50f2f9ec76d1aac3d Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sat, 7 Sep 2019 14:04:23 -0400 Subject: [PATCH] [+] Create http field in App.ts --- src/components/app/app.ts | 7 +++++++ src/utils/http-utils.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/app/app.ts b/src/components/app/app.ts index 5449641..befe5f3 100644 --- a/src/components/app/app.ts +++ b/src/components/app/app.ts @@ -5,6 +5,7 @@ import Overall from '@/pages/overall/overall'; import Constants from '@/constants'; import JsonUtils from '@/utils/json-utils'; import pWaitFor from 'p-wait-for'; +import {HttpUtils} from '@/utils/http-utils'; /** * Objects of this interface represent assignment grades. @@ -55,6 +56,9 @@ export default class App extends Vue // Token public token: string = ''; + // Http Client + public http: HttpUtils = new HttpUtils(''); + /** * This is called when the instance is created. */ @@ -77,6 +81,9 @@ export default class App extends Vue // Store token this.token = token; + // Assign token to http client + this.http.token = token; + // Load data this.loadCoursesAfterLogin(); } diff --git a/src/utils/http-utils.ts b/src/utils/http-utils.ts index 6e03f25..ac00b72 100644 --- a/src/utils/http-utils.ts +++ b/src/utils/http-utils.ts @@ -2,7 +2,7 @@ import Constants from '@/constants'; export class HttpUtils { - private token: string = ''; + public token: string = ''; constructor (token: string) {