我有一个 index.pug 页面:
head
title My Title
body
form(method="GET", action='/#{redirect_url}')
button(type='submit') run foo
在我的 app.js 中:
app.get('/', (req, res) => {
res.render('index', {
redirect_url: '/foo'
});
});
app.get('/foo', (req, res) => {
res.status(200).send('Foo triggered');
});
我被重定向到 http://localhost:3000/?#{redirect_url}。
我想重定向到 http://localhost:3000/redirect_url?
当我不使用变量时它工作正常。
我附上了截图以供参考。
试试
action=`${baseRoute}/${redirect_url}`