Blacked and isorted the python files
Prettied and eslinted the typescript/html files
This commit is contained in:
@ -1,13 +1,10 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class CookieService {
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
public getCookie(name: string) {
|
||||
const ca: Array<string> = document.cookie.split(';');
|
||||
const caLen: number = ca.length;
|
||||
@ -27,10 +24,11 @@ export class CookieService {
|
||||
this.setCookie(name, '', -1);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
public setCookie(name: string, value: string, expireDays: number, path: string = '') {
|
||||
const d: Date = new Date();
|
||||
d.setTime(d.getTime() + expireDays * 24 * 60 * 60 * 1000);
|
||||
const expires: string = 'expires=' + d.toUTCString();
|
||||
document.cookie = name + '=' + value + '; ' + expires + (path.length > 0 ? '; path=' + path : '');
|
||||
const expires = `expires=${d.toUTCString()}`;
|
||||
document.cookie = `${name}=${value}; ${expires}${path.length > 0 ? `; path=${path}` : ''}`;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user