Browse Source

fix: 路由跳转错误

main
刘凯 1 year ago
parent
commit
93af48c6fc
  1. 6
      src/store/modules/user.ts

6
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,

Loading…
Cancel
Save