Initial commit
This commit is contained in:
26
wwwroot/core/usersToken.js
Normal file
26
wwwroot/core/usersToken.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import JsonManager from "./utils/jsonManager.js";
|
||||
|
||||
export class UsersToken {
|
||||
constructor(filePath) {
|
||||
this.filePath = filePath;
|
||||
this.data = JsonManager.read(this.filePath);
|
||||
}
|
||||
|
||||
reload() {
|
||||
this.data = JsonManager.read(this.filePath);
|
||||
}
|
||||
|
||||
upsert(data) {
|
||||
JsonManager.upsertToken(this.filePath, data);
|
||||
this.reload();
|
||||
}
|
||||
|
||||
get(index){
|
||||
return this.data[index];
|
||||
}
|
||||
|
||||
getAll(){
|
||||
return this.data;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user