0
服務器的代碼是在這裏:https://github.com/Bubblery/server.js/blob/master/.gitignore如何重定向到另一個頁面,沒有任何明示
,並在103我有一個條件。然後我想重定向另一個頁面。就像「index.html」一樣。
服務器的代碼是在這裏:https://github.com/Bubblery/server.js/blob/master/.gitignore如何重定向到另一個頁面,沒有任何明示
,並在103我有一個條件。然後我想重定向另一個頁面。就像「index.html」一樣。
你在一個地方的範圍和req
是res
可用,所以就這樣結束它和輸出重定向頭
if (results.length > 0) {
results.forEach(function (key) {
if (key.password != userParsed.password) {
res.writeHead(301, {
'Location': 'your/path/file.html'
});
res.end();
} else {
console.log(key.password);
}
});
}
嗨,我試了一下..但沒用,頁面沒有重定向。 – Bubble