[U] Update http-utils to use token.token

This commit is contained in:
Hykilpikonna
2019-10-12 20:14:33 -04:00
parent 6d191f04fb
commit 543b0ddefe
+7 -3
View File
@@ -1,10 +1,11 @@
import Constants from '@/constants';
import {Token} from '@/components/app/app';
export class HttpUtils
{
public token: string = '';
public token: Token;
constructor (token: string)
constructor (token: Token)
{
this.token = token;
}
@@ -12,7 +13,10 @@ export class HttpUtils
public post(node: string, body: any): Promise<any>
{
// Add token
if (this.token != '') body['token'] = this.token;
if (this.token != null)
{
body['token'] = this.token.token;
}
// Create promise
return new Promise<any>((resolve, reject) =>