2024-07-11 20:11:11 +08:00
|
|
|
import { useCoreTabbarStore } from '@vben-core/stores';
|
2024-07-05 23:15:46 +08:00
|
|
|
|
|
|
|
import { defineStore } from 'pinia';
|
|
|
|
|
2024-07-11 20:11:11 +08:00
|
|
|
import { useAccessStore } from './access';
|
|
|
|
|
2024-07-05 23:15:46 +08:00
|
|
|
export const useAppStore = defineStore('app', () => {
|
2024-07-11 20:11:11 +08:00
|
|
|
const accessStore = useAccessStore();
|
2024-07-05 23:15:46 +08:00
|
|
|
const coreTabbarStore = useCoreTabbarStore();
|
|
|
|
|
|
|
|
/**
|
2024-07-06 15:49:21 +08:00
|
|
|
* 重置所有状态
|
2024-07-05 23:15:46 +08:00
|
|
|
*/
|
|
|
|
async function resetAppState() {
|
2024-07-11 20:11:11 +08:00
|
|
|
accessStore.$reset();
|
2024-07-05 23:15:46 +08:00
|
|
|
coreTabbarStore.$reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
resetAppState,
|
|
|
|
};
|
|
|
|
});
|