[+] Create http field in App.ts

This commit is contained in:
Hykilpikonna
2019-09-07 14:04:23 -04:00
parent 06c265159b
commit 393fc1cc71
2 changed files with 8 additions and 1 deletions
+7
View File
@@ -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();
}
+1 -1
View File
@@ -2,7 +2,7 @@ import Constants from '@/constants';
export class HttpUtils
{
private token: string = '';
public token: string = '';
constructor (token: string)
{