diff --git a/packages/fes-plugin-layout/src/runtime/runtime.js b/packages/fes-plugin-layout/src/runtime/runtime.js index e5022259..7f604de5 100644 --- a/packages/fes-plugin-layout/src/runtime/runtime.js +++ b/packages/fes-plugin-layout/src/runtime/runtime.js @@ -7,11 +7,15 @@ if (!accessApi) { throw new Error('[plugin-layout]: plugin-layout depends on plugin-access,please install plugin-access first!'); } -const accessIds = accessApi.getAccess(); -accessApi.setAccess(accessIds.concat(['/403', '/404'])); - export const access = (memo) => { const runtimeConfig = getConfig(); + const accessIds = accessApi.getAccess(); + if (!accessIds.includes('/403')) { + accessApi.setAccess(accessIds.concat('/403')); + } + if (!accessIds.includes('/404')) { + accessApi.setAccess(accessIds.concat('/404')); + } return { unAccessHandler({ router, to, from, next }) { if (runtimeConfig.unAccessHandler && typeof runtimeConfig.unAccessHandler === 'function') { diff --git a/packages/fes-preset-built-in/src/plugins/core/route/index.js b/packages/fes-preset-built-in/src/plugins/core/route/index.js index 8cfc6433..2fe2039a 100644 --- a/packages/fes-preset-built-in/src/plugins/core/route/index.js +++ b/packages/fes-preset-built-in/src/plugins/core/route/index.js @@ -55,12 +55,12 @@ const getRoutePath = function (parentRoutePath, fileName, isFile = true) { } // /@id.vue -> /:id if (fileName.startsWith('@')) { - logger.warn(`[WARNING]: ${fileName} is deprecated, please use [slug]`); + logger.warn(`[WARNING]: filename or directory ${fileName} is deprecated, please use [${fileName.replace(/@/, '')}]`); fileName = fileName.replace(/@/, ':'); } // /*.vue -> :pathMatch(.*) if (fileName.includes('*')) { - logger.warn(`[WARNING]: ${fileName} is deprecated, please use [...slug]`); + logger.warn(`[WARNING]: filename or directory ${fileName} is deprecated, please use ${fileName.replace('*', '[...]')}`); fileName = fileName.replace('*', ':pathMatch(.*)'); } // /[slug].vue -> /:slug