add store auto closed day

This commit is contained in:
Timi
2026-08-12 12:03:47 +08:00
parent 171aee1602
commit 2a64f2ad72
6 changed files with 95 additions and 93 deletions
+16
View File
@@ -101,6 +101,21 @@ export const useCurrentStoreStore = defineStore("currentStore", () => {
}
}
async function refreshCurrentStore(storeId = currentStoreId.value): Promise<void> {
if (!storeId || storeId !== currentStoreId.value) {
return;
}
const result = await StoreAPI.detail(storeId);
const index = storeList.value.findIndex(item => item.id === storeId);
if (-1 < index) {
storeList.value.splice(index, 1, result);
}
if (loginStore.value?.id === storeId) {
loginStore.value = result;
}
}
function selectStore(storeId: string): void {
if (!storeId) {
return;
@@ -133,6 +148,7 @@ export const useCurrentStoreStore = defineStore("currentStore", () => {
loadStoreList,
loadLoginStore,
loadAfterLogin,
refreshCurrentStore,
selectStore
};
});