diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 1b9987e4..bae9af22 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -157,11 +157,15 @@ export const useUserStore = defineStore('app-user', { const component = __menu.path.replaceAll(/\/:[\s|\S]*/g, '') + let isPadIndexExtension = false + if (!component.endsWith('index') && !/\/:/.test(__menu.path)) + isPadIndexExtension = true + menus.push({ id: __menu.id, parentId: __menu.parentId, name: __menu.name, - component: `${component}${component.endsWith('index') ? '' : '/index'}.vue`, + component: `${component}${isPadIndexExtension ? '/index' : ''}.vue`, componentName, path: __menu.path, icon: __menu.source,