我正在研究快递js,我需要重定向到需要身份验证的页面.这是我的代码:
router.get('/ren', function(req, res) {
var username = 'nik',
password = 'abc123',
auth = 'Basic ' + new Buffer(username + ':' + password).toString('base64');
res.redirect('http://localhost:3000/api/oauth2/authorize');
})
Run Code Online (Sandbox Code Playgroud)
如何设置此重定向命令的标头?