mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(kit): don't warn if middleware is added twice
This commit is contained in:
parent
196223c0fb
commit
08b656a047
@ -51,6 +51,7 @@ export function addRouteMiddleware (input: NuxtMiddleware | NuxtMiddleware[], op
|
||||
for (const middleware of middlewares) {
|
||||
const find = app.middleware.findIndex(item => item.name === middleware.name)
|
||||
if (find >= 0) {
|
||||
if (app.middleware[find].path === middleware.path) { continue }
|
||||
if (options.override === true) {
|
||||
app.middleware[find] = middleware
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user