Koa-router Accepts post Requests How to Jump Pages

  node.js, question

When using koa-router to manage routes, you want to redirect to another route after receiving the form post request, but neither this.redirect nor router.redirect can jump. What is the correct way to write it?
Invalid code:

router.post('/login', bodyParser, function* (next) {
 //   ...
 this.redirect('/index');
 });
router.get('user', '/users/:id', function *(next) {
 //     ...
 });
 
 router.url('user', 3);
 // => "/users/3"

The koa-router document is written by inside. Similarly, router.redirect

You can also write it directly into this to conform to your habits.