import {defineStore} from 'pinia'
import pinia from "../store/init"
import config from '../config/index';
import {clearStorage} from "@/utils/storage";

export const useAppStore = defineStore('main', {
	//getStorage, setStorage,
    state: () => ({
        onUpdate: null,
    }),
    actions: {
        setOnUpdate(value) {
            this.onUpdate = value
        },
        //清除缓存和token
        clearStoreData() {
            this.onUpdate = null
            clearStorage()
        },
    }
})

export default function useUserStoreWidthOut() {
    return useAppStore(pinia);
}
