ppob-frontend/src/store/index.js
2021-12-14 18:52:42 +07:00

32 lines
952 B
JavaScript

import { UI } from "./ui";
import { Authentication } from "./authentication";
import { User } from "./user";
import { Membership } from "./membership";
import { Product } from "./product";
import { Partner } from "./partner";
import { Supplier } from "./supplier";
import { Commission } from "./commission";
import { Transaction } from "./transaction";
import { TokenUtil } from "../utils/token";
import { Role } from "./role";
export class Store {
ui = new UI(this);
authentication = new Authentication(this);
user = new User(this);
membership = new Membership(this);
product = new Product(this);
partner = new Partner(this);
supplier = new Supplier(this);
commission = new Commission(this);
transaction = new Transaction(this);
role = new Role(this);
constructor() {
TokenUtil.loadToken();
if (TokenUtil.accessToken) {
this.authentication.isLoggedIn = true;
}
}
}