使用req.headers["authorization"]获取
app.get("/api/shoppingCart", (req, res) => {
let Authorization = req.headers["authorization"]; // 但是注意这里的authorization必须是小写的!
xxxxxxxxxxxxxxxxxx
});
但是注意这里的authorization必须是小写的!重要的事说三遍!重要的事说三遍!
重要的事说三遍! 如果写成大写就会获取不到值直接报undefined!