add StoreDiary
This commit is contained in:
+12
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user