egg icon indicating copy to clipboard operation
egg copied to clipboard

[BUG] 中间件 和 egg-mongoose 一起使用 返回404

Open djfos opened this issue 8 years ago • 3 comments

  • Node Version: v8.9.4:
  • Egg Version: ^2.6.1:
  • Plugin Name: egg-mongoose:
  • Plugin Version: ^2.2.1:
  • Platform: win10:
  • Mini Showcase Repository: https://github.com/djfos/egg-bug-replay-middleware-mongoose

brief

router

router

controller

controller

middleware

mw

config

config

plugin

plugin

问题

  1. 中间件 和 mongoose 一起用,返回404 plugin

  2. 中间件 和 mongoose 只用其中一个,返回 hi eeg plugin

补充

  • 工具 postman
  • 本地数据库是空的

djfos avatar Jun 12 '18 15:06 djfos

Translation of this issue:


[BUG] Middleware and egg-mongoose work together to return 404

  • Node Version: v8.9.4:
  • Egg Version: ^2.6.1:
  • Plugin Name: egg-mongoose:
  • Plugin Version: ^2.2.1:
  • Platform: win10:
  • Mini Showcase Repository: https://github.com/djfos/egg-bug-replay-middleware-mongoose

brief

router

router

controller

controller

middleware

mw

config

config

plugin

plugin

problem

  1. Middleware is used with mongoose, returning 404   plugin

  2. Middleware and mongoose use only one of them, returning hi eeg plugin

Supplement

  • Tools postman
  • The local database is empty

egg-bot avatar Jun 12 '18 15:06 egg-bot

await next() in middleware

popomore avatar Jun 12 '18 15:06 popomore

楼上正解,我也碰到了这个问题

pf135145 avatar Jul 20 '18 09:07 pf135145