标签:out mobile mob nod cas oid ase 请求 androi
function getMachine(req) { var deviceAgent = req.headers["user-agent"].toLowerCase(); var agentID = deviceAgent.match(/(iphone|ipod|ipad|android)/); if (agentID) { return "Mobile"; } else { return "PC"; } }
router.get("/",function (req,res,next) { var machine = getMachine(req); res.send(machine); })
标签:out mobile mob nod cas oid ase 请求 androi
原文地址:https://www.cnblogs.com/muamaker/p/9847821.html