Session data can be cleared without reloading the page

This commit is contained in:
NI
2019-10-22 08:38:31 +08:00
parent 64acf3e0a6
commit e048671bfd
5 changed files with 55 additions and 0 deletions

View File

@@ -113,6 +113,23 @@ export class History {
this.saver(this, this.records);
}
/**
* Clear session data
*
* @param {string} uid unique name
*
*/
clearSession(uid) {
for (let i in this.records) {
if (this.records[i].uname !== uid) {
continue;
}
this.records[i].session = null;
break;
}
}
/**
* Return all history records
*