add StoreDiary

This commit is contained in:
Timi
2026-08-31 17:32:01 +08:00
parent 95a400cd93
commit 1e83fdf883
9 changed files with 1288 additions and 1 deletions
+12 -1
View File
@@ -124,12 +124,23 @@ router.beforeEach(async (to) => {
async function resolveStoreAccessRedirect(to: RouteLocationNormalized): Promise<string | undefined> {
const userStore = useUserStore();
const routeName = String(to.name || "");
const storeDiaryRouteNameList = ["StoreDiaryList", "StoreDiaryCreate", "StoreDiaryDetail", "StoreDiaryEdit"];
if (storeDiaryRouteNameList.includes(routeName)) {
if (!userStore.hasRoles(gaoRoleCodes.storeManager) || userStore.hasRoles(gaoRoleCodes.globalManager)) {
return "/management";
}
const currentStoreStore = useCurrentStoreStore();
const store = await currentStoreStore.loadLoginStore();
return store?.id ? undefined : "/management";
}
if (!userStore.hasRoles(gaoRoleCodes.storeManager) || userStore.hasRoles(gaoRoleCodes.globalManager)) {
return undefined;
}
const storeRouteNameList = ["StoreList", "StoreCreate", "StoreSort", "StoreEdit", "StoreBusinessDayCalendar"];
if (!storeRouteNameList.includes(String(to.name || ""))) {
if (!storeRouteNameList.includes(routeName)) {
return undefined;
}