import { defineStore } from "pinia";
import { UserState } from "@/stores/interface";

import piniaPersistConfig from "@/config/piniaPersist";

export const useUserStore = defineStore({
    id: "ops-user",
    state: (): UserState => ({
        newUserToken: "", //模拟token,请及时删掉
        userInfo: {},
        orgIdArr: [],
        orgId: 0,
        orgName: "",
        warehouse: [],
        dept: [],
        companyId: ""
    }), //模拟数据,请及时删除
    getters: {},
    actions: {
        // Set Token
        setToken(token: string) {
            this.newUserToken = token;
        }
    },
    persist: piniaPersistConfig("ops-user")
});
