add store auto closed day
This commit is contained in:
@@ -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
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user