[+] Create http field in App.ts
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import Constants from '@/constants';
|
||||
|
||||
export class HttpUtils
|
||||
{
|
||||
private token: string = '';
|
||||
public token: string = '';
|
||||
|
||||
constructor (token: string)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user